summaryrefslogtreecommitdiffstats
path: root/wp-includes/pluggable.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-07-15 17:22:59 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-07-15 17:22:59 +0000
commit1d6b7c9a990f68f0f9b599d61678c71d40251704 (patch)
tree8f6f5206f365be2062ff98c3be887d47899b1a2a /wp-includes/pluggable.php
parenta8a5dc5214b92fc26003983f599dd25e88660084 (diff)
downloadwordpress-mu-1d6b7c9a990f68f0f9b599d61678c71d40251704.tar.gz
wordpress-mu-1d6b7c9a990f68f0f9b599d61678c71d40251704.tar.xz
wordpress-mu-1d6b7c9a990f68f0f9b599d61678c71d40251704.zip
WP Merge with rev 8339
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1374 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/pluggable.php')
-rw-r--r--wp-includes/pluggable.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php
index 9b8bb4f..8041f28 100644
--- a/wp-includes/pluggable.php
+++ b/wp-includes/pluggable.php
@@ -833,7 +833,10 @@ function wp_safe_redirect($location, $status = 302) {
if ( substr($location, 0, 2) == '//' )
$location = 'http:' . $location;
- $lp = parse_url($location);
+ // 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);
$wpp = parse_url(get_option('home'));
$allowed_hosts = (array) apply_filters('allowed_redirect_hosts', array($wpp['host']), isset($lp['host']) ? $lp['host'] : '');