[wp-trac] [WordPress Trac] #36356: Function signature of wp_parse_url() does not match parse_url()

WordPress Trac noreply at wordpress.org
Tue Oct 4 13:08:16 UTC 2016


#36356: Function signature of wp_parse_url() does not match parse_url()
--------------------------------------+----------------------------
 Reporter:  johnbillion               |       Owner:  peterwilsoncc
     Type:  defect (bug)              |      Status:  assigned
 Priority:  normal                    |   Milestone:  4.7
Component:  HTTP API                  |     Version:  4.4
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+----------------------------

Comment (by jrf):

 @peterwilsoncc

 > I've looked over the spec and can't find anything about query parameters
 beginning with &, are you able to send a pointer.

 This is similar to other invalidly formatted urls being passed to this
 function and being corrected by it. Invalid formats are not in the specs.

 As you removed the fix now, you  might as well remove the tests for it as
 they do not have any added value unless the fix for it is in (and the
 unfixed results just don't make sense).


 > I get consistent results

 The HHVM fix has been removed in your patch - will that still be caught
 now ? HHVM will sometimes take the `:###` in the query string of the
 google font urls and use it as the port. See my previous fix for that.


 Looked over the rest of the code.

 I generally like the simplification. Wished I dared to do that. I
 considered it, but my experience with contributing to WP core has been
 that any time I change things drastically, the change gets rejected out of
 hand, so glad you have the whuffies to do it.

 Only other point - I would suggest wrapping the unset `foreach` at the end
 of the function within a `if ( false !== $parts ) {}`

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


More information about the wp-trac mailing list