From 4680f618c31d0301dbe597bde4d6a5292e7dcdf5 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 30 Aug 2005 04:17:52 +0000 Subject: [PATCH] Allow query strings at the end of cruftless URIs. Props Owen and Mark. fixes #1581 git-svn-id: https://develop.svn.wordpress.org/trunk@2823 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/classes.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wp-includes/classes.php b/wp-includes/classes.php index 1c1e9207e5..f173c73860 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -1330,8 +1330,7 @@ class WP { ('/' != $_SERVER['PATH_INFO']) && (false === strpos($_SERVER['PATH_INFO'], '.php')) ) || - (empty($_SERVER['QUERY_STRING']) && - (false === strpos($_SERVER['REQUEST_URI'], '.php')) && + ((false === strpos($_SERVER['REQUEST_URI'], '.php')) && ('/' != $_SERVER['REQUEST_URI'])) ) { @@ -1345,7 +1344,11 @@ class WP { if (! empty($rewrite)) { $pathinfo = $_SERVER['PATH_INFO']; - $req_uri = $_SERVER['REQUEST_URI']; + $pathinfo_array = explode('?', $pathinfo); + $pathinfo = $pathinfo_array[0]; + $req_uri = $_SERVER['REQUEST_URI']; + $req_uri_array = explode('?', $req_uri); + $req_uri = $req_uri_array[0]; $home_path = parse_url(get_settings('home')); $home_path = $home_path['path'];