[wp-trac] [WordPress Trac] #48242: Deprecate wp_parse_url() in favour of native parse_url()
WordPress Trac
noreply at wordpress.org
Mon Oct 7 18:58:13 UTC 2019
#48242: Deprecate wp_parse_url() in favour of native parse_url()
------------------------------+------------------------------------------
Reporter: johnbillion | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 5.2
Severity: normal | Keywords: needs-patch needs-unit-tests
Focuses: coding-standards |
------------------------------+------------------------------------------
The `wp_parse_url()` function exists to handle inconsistencies in the
return value of PHP's native `parse_url()` function across different
versions of PHP.
According to its inline docs:
> PHP 5.4.7 expanded parse_url()'s ability to handle non-absolute url's,
including schemeless and relative url's with :!// in the path. This
function works around those limitations providing a standard output on PHP
5.2~5.4+.
> Error suppression is used as prior to PHP 5.3.3, an E_WARNING would be
generated when URL parsing failed.
Now that core only supports PHP 5.6+, it should be possible to deprecate
this function and replace usage of it with the native `parse_url()`
function. However, to ensure that nothing breaks we'll need tests which
determines that `parse_url()` functions identically to `wp_parse_url()` on
PHP 5.6 and above.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48242>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list