[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 00:21:05 UTC 2016


#36356: Function signature of wp_parse_url() does not match parse_url()
--------------------------------------+-----------------------------
 Reporter:  johnbillion               |       Owner:  SergeyBiryukov
     Type:  defect (bug)              |      Status:  reopened
 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
 > The `=== $url[0]` in that patch will throw a notice if an empty string
 is passed to the function, are you able to add a couple of invalid use
 cases while refining the tests? I think this has been in WP since forever
 and I didn't think to test it over the weekend.

 While I agree that's an issue, it's not an issue with the patch as it's
 been - like you say - '''''in WP since forever'''''.

 I detect a distinct case of scope creep here. This ticket is about adding
 the `$component` parameter (without breaking anything else), nothing more.
 Variable & type checking has never been WP's strong suite, this function
 is no exception and the adding of the `$component` parameter has already
 made improvements in that respect (maybe even more than the ticket
 warrants).

 I will add the empty string check in as it's an easy fix, but for anything
 else, I'd suggest opening a separate ticket.



 > From rudimentary testing, placeholder schemes and hosts seem the most
 reliable across versions of PHP. Can they be used and unset generally?
 Version sniffing is proving unreliable.

 Version sniffing was already removed in my edge-cases patch from three
 days ago, so I don't understand what you're talking about.
 Similarly, placeholder schemes and hosts are already being used and unset
 when appropriately, so what is you point here ?

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


More information about the wp-trac mailing list