[wp-trac] [WordPress Trac] #18117: get_blog_details is sensitive to path's trailing slash

WordPress Trac noreply at wordpress.org
Mon Jan 12 04:00:08 UTC 2015


#18117: get_blog_details is sensitive to path's trailing slash
--------------------------------+-------------------------
 Reporter:  mitchoyoshitaka     |       Owner:  jeremyfelt
     Type:  defect (bug)        |      Status:  reopened
 Priority:  normal              |   Milestone:  4.2
Component:  Networks and Sites  |     Version:  3.0
 Severity:  normal              |  Resolution:
 Keywords:  has-patch           |     Focuses:  multisite
--------------------------------+-------------------------
Changes (by jeremyfelt):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 After a [https://wordpress.slack.com/archives/core/p1421033301000142
 conversation] and some thought, I was stretching a bit in an earlier patch
 to "validate" the number of slashes in all segments of a saved path. This
 isn't necessarily the right place to do that, especially because
 `array_filter()` will strip out some valid paths - try `/my-site/0/`.

 By using `$details[ $field ] = trailingslashit( '/' . trim( $details[
 $field ], '/' ) );`, we can make sure any number of slashes on the front
 and back are stripped before adding ours back in.

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


More information about the wp-trac mailing list