Suppress possible warnings in PHP < 5.3.3 by parse_url()
in wp_validate_redirect()
.
PHP 5.3.3 removed the E_WARNING that was emitted when URL parsing failed. git-svn-id: https://develop.svn.wordpress.org/trunk@36446 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
5bf2ce0d66
commit
7bc7bd07d4
@ -1326,7 +1326,8 @@ function wp_validate_redirect($location, $default = '') {
|
||||
// In php 5 parse_url may fail if the URL query part contains http://, bug #38143
|
||||
$test = ( $cut = strpos($location, '?') ) ? substr( $location, 0, $cut ) : $location;
|
||||
|
||||
$lp = parse_url($test);
|
||||
// @-operator is used to prevent possible warnings in PHP < 5.3.3.
|
||||
$lp = @parse_url($test);
|
||||
|
||||
// Give up if malformed URL
|
||||
if ( false === $lp )
|
||||
|
Loading…
Reference in New Issue
Block a user