Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix possible undefined warning with parsed site url

If parse_url() does not return a path key, the check for the value of path can cause a warning in PHP.

Check to see that the path key exists before trying to compare it.
  • Loading branch information...
commit f157bf0bad292684ce47f17d1704e8fe82462215 1 parent 9ae98d9
@jeremyfelt jeremyfelt authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  safe-redirect-manager.php
View
2  safe-redirect-manager.php
@@ -703,7 +703,7 @@ public function action_parse_request() {
* the pre-WP path off the requested path.
*/
$parsed_site_url = parse_url( site_url() );
- if ( '/' != $parsed_site_url['path'] ) {
+ if ( isset( $parsed_site_url['path'] ) && '/' != $parsed_site_url['path'] ) {
$requested_path = preg_replace( '@' . $parsed_site_url['path'] . '@i', '', $requested_path, 1 );
}
Please sign in to comment.
Something went wrong with that request. Please try again.