[wp-trac] [WordPress Trac] #55753: PHP deprecated notice from parse_url() in url_to_postid()

WordPress Trac noreply at wordpress.org
Sun May 29 16:19:51 UTC 2022

#55753: PHP deprecated notice from parse_url() in url_to_postid()
 Reporter:  lagios.di     |       Owner:  SergeyBiryukov
     Type:  defect (bug)  |      Status:  accepted
 Priority:  normal        |   Milestone:  6.1
Component:  Permalinks    |     Version:  5.9
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
Changes (by lopo):

 * version:   => 5.9


 I applied a simple safeguard to the output from `parse_url()` to make sure
 we're passing a string to `str_replace()`.

 We can't bail out early as @dd32 suggested because `url_to_postid()`
 currently supports arguments such as `'/example/examp'`, as
 the unit tests show] so I'm just preventing the deprecation here.

 Setting version to 5.9 since it's the first version "beta-supporting" PHP

Ticket URL: <https://core.trac.wordpress.org/ticket/55753#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list