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. Built from https://develop.svn.wordpress.org/trunk@36446 git-svn-id: http://core.svn.wordpress.org/trunk@36413 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5c4031dd84
commit
72c6f7f86f
|
@ -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
|
// 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;
|
$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
|
// Give up if malformed URL
|
||||||
if ( false === $lp )
|
if ( false === $lp )
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.5-alpha-36445';
|
$wp_version = '4.5-alpha-36446';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue