[wp-trac] [WordPress Trac] #55333: PHP Notice in strip_fragment_from_url() when schemeless URI is passed

WordPress Trac noreply at wordpress.org
Tue Mar 8 00:56:21 UTC 2022


#55333: PHP Notice in strip_fragment_from_url() when schemeless URI is passed
--------------------------+-----------------------------
 Reporter:  dd32          |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Canonical     |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Related to [52829] is this PHP Notice that seems to be triggering on a
 `the_content` filter after that change:

 {{{
 GET https://wordpress.org/news/2014/04/smith/

 E_NOTICE: Undefined index: scheme in wp-includes/canonical.php:854
 Undefined index: scheme
 }}}

 The input in this case is a URL such as
 `//wordpress.org/news/files/2014/04/widgets.mp4`.

 I also note that `strip_fragment_from_url()` doesn't use `wp_parse_url()`
 but uses `parse_url()` directly.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55333>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list