[wp-trac] [WordPress Trac] #53938: replace core uses of wp_parse_url() with PHP's native parse_url()

WordPress Trac noreply at wordpress.org
Tue Aug 17 00:16:20 UTC 2021


#53938: replace core uses of wp_parse_url() with PHP's native parse_url()
-------------------------------------------+------------------------------
 Reporter:  pbiron                         |       Owner:  (none)
     Type:  enhancement                    |      Status:  new
 Priority:  normal                         |   Milestone:  Awaiting Review
Component:  HTTP API                       |     Version:
 Severity:  normal                         |  Resolution:
 Keywords:  needs-patch 2nd-opinion close  |     Focuses:
-------------------------------------------+------------------------------
Changes (by jrf):

 * keywords:  needs-patch 2nd-opinion => needs-patch 2nd-opinion close


Comment:

 The conclusion from the discussion in the previous ticket #48242, as
 referenced by @johnbillion, still stands:
 1. There is still a PHP cross-version incompatibility (to do with handling
 of colons vs ports) which is handled by the `wp_parse_url()` function,
 which is not handled correctly/consistently in PHP when taking all PHP
 versions currently supported by WP into account.
 2. And as @dd32 quite rightly states in the previous ticket: the PHP
 native function has a history of lagging behind in support for new URL
 formats (like schemeless etc) and fixes are not backported to older PHP
 versions, so it is likely that there will be new PHP cross-version
 differences to work around in the future.

 All in all, keeping the function in place and recommending for people to
 use the WP version rather than the PHP version still seems the prudent way
 forward.

 It might be a better idea to do a careful review of the current uses of
 the PHP native `parse_url()` function in WP Core (and there are quite a
 few) to see if those should be switched over/back to using
 `wp_parse_url()` instead.

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


More information about the wp-trac mailing list