Opened 9 years ago
Closed 8 years ago
#42452 closed defect (bug) (fixed)
filter_rest_url_for_leading_slash assertion is broken
| Reported by: | rmccue | Owned by: | rmccue |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.0 |
| Component: | REST API | Version: | 4.4 |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | Focuses: |
Description
This is originally from https://github.com/WP-API/WP-API/issues/2424
The test checks if rest_url() was called with a leading slash and fails if it wasn't. This is broken because WordPress core itself calls rest_url() with no leading slashes in a few places (notably, WP_REST_Posts_Controller::prepare_links).
This is never surfaced in core, because the test only fails if permalink_structure is set, which it isn't in the tests. Third-party tests which use this base class and which set a permalink structure will fail (unless they're on multisite, in which case the test is bypassed anyway).
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
In 42250: