#3718 closed defect (bug) (fixed)
bbp_view_query() runs an unrestricted query for unknown views
| Reported by: | johnjamesjacoby | Owned by: | johnjamesjacoby |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.6.20 |
| Component: | API - Topic Views | Version: | 2.0 |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: |
Description
bbp_view_query() only bails when the resolved view ID is empty. Passing an unknown nonempty slug therefore receives empty arguments from bbp_get_view_query_args() and falls through to bbp_has_topics(), which runs the default all-topics query instead of returning false as documented.
The fix should preserve both registered views whose arguments filter to an empty array and extensions that provide filtered arguments for virtual views. It should return false only when the slug is unregistered and no filtered query arguments exist.
Regression coverage should exercise unknown, registered, filtered virtual, and empty-filtered registered views.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
In 7872: