#40542 closed defect (bug) (fixed)
Undefined index in strip_fragment_from_url function
| Reported by: | betterstudio | Owned by: | DrewAPicture |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.9 |
| Component: | Canonical | Version: | 4.4 |
| Severity: | normal | Keywords: | has-patch dev-feedback |
| Cc: | Focuses: |
Description
There is undefined index in strip_fragment_from_url function for
$parsed_url['path']
path should be checked to be available. Simple check needed:
if ( ! empty( $parsed_url['path'] ) )
file: wp-includes/canonical.php line 570
Attachments (1)
Change History (8)
#2
@
9 years ago
Hi @ocean90
I can't remember it now because i saw it 6 week ago in one of our customers site!
It does not matter! You can check this code: {{{#!php
<?php
strip_fragment_from_url( 'http://betterstudio.com' );
}}}
That function will make a warning!
Notice: Undefined index: path in .../wp.dev/wp-includes/canonical.php on line 570
#4
@
9 years ago
- Keywords has-patch dev-feedback added; needs-patch removed
In the function the other array index are checked except this one so as suggested on the ticket this will avoid problems :-)
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Hello @betterstudio, welcome to WordPress Trac!
So far
strip_fragment_from_url()is only used inredirect_canonical(). What URL are you trying to access to get this warning?