From 7bc7bd07d4a07544b567ce25f099b0bd658e8560 Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Tue, 2 Feb 2016 16:33:02 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@36446 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/pluggable.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/pluggable.php b/src/wp-includes/pluggable.php index 7c38b6d67b..2e2d4de3b6 100644 --- a/src/wp-includes/pluggable.php +++ b/src/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 )