[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:25:42 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:
-------------------------------------------+------------------------------

Comment (by pbiron):

 Replying to [comment:6 jrf]:
 > 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.

 Good thing I didn't rush to put a patch together to replace current uses
 of `wp_parse_url()` with `parse_url()` :-)

 Sergey counted 113 uses of `parse_url()` vs 39 of `wp_parse_url()`.

 So, sounds like the 1st course of action is to check whether there are
 unit tests that cover all current core uses of `parse_url()` and add unit
 tests for cases that don't have them.  Then, we can decide which uses
 could/should be replaced with `wp_parse_url()` without introducing
 backwards compatibility problems.

 I'm really busy right now, but if no one beats me to, I'll start
 inventorying the unit tests for the current uses  of `parse_url()`.

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


More information about the wp-trac mailing list