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:
Dominik Schilling 2016-02-02 16:34:27 +00:00
parent 5c4031dd84
commit 72c6f7f86f
2 changed files with 3 additions and 2 deletions

View File

@ -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 )

View File

@ -4,7 +4,7 @@
*
* @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.