From 72c6f7f86f133a0d5ec669526eeb29ca024c0c19 Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Tue, 2 Feb 2016 16:34:27 +0000 Subject: [PATCH] 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 --- wp-includes/pluggable.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 7c38b6d67b..2e2d4de3b6 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -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 ) diff --git a/wp-includes/version.php b/wp-includes/version.php index 347943765a..eb6f9871f5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.