[wp-trac] [WordPress Trac] #57048: Handle trailing slashes in rest_preload_api_request

WordPress Trac noreply at wordpress.org
Mon Oct 14 16:37:52 UTC 2024


#57048: Handle trailing slashes in rest_preload_api_request
-------------------------------------------------+-------------------------
 Reporter:  spacedmonkey                         |       Owner:  swissspidy
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  6.8
Component:  REST API                             |     Version:  5.0
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests has-        |     Focuses:  rest-api
  testing-info                                   |
-------------------------------------------------+-------------------------

Comment (by antonvlasenko):

 Replying to [comment:4 spacedmonkey]:
 > Me and @swissspidy came across this issue while working web stories
 together. We patched it in our own code.
 [https://github.com/GoogleForCreators/web-stories-
 wp/blob/dcb4fe9f41ea81865adc8004cf44dbd799129f81/includes/namespace.php#L178-L243
 Here] is our version of this function.
 >
 > I can't remember now how we fixed this issue, but look at the git
 history.

 Thank you for the hint, @spacedmonkey.
 I believe this commit addresses the issue in your version of the function:
 https://github.com/GoogleForCreators/web-stories-
 wp/commit/a7f4977f74d24f73c0a72d23501f6a1eb7ac9337#diff-
 e38e7938d6df1990969cd7d147a8d590b359fa3a96a33802c85aa5723abf0223R188

 The proposed solution in this PR appears to not only resolve the issue you
 mentioned, but also correct the key at which preloaded data is stored
 (within the context of `array_reduce()`).

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57048#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list