From e7e5b63493864722bf16969e1615743980a51fa6 Mon Sep 17 00:00:00 2001 From: rboren Date: Wed, 15 Sep 2004 08:16:58 +0000 Subject: [PATCH] Make $pagenow work with PATH_INFO. git-svn-id: http://svn.automattic.com/wordpress/trunk@1663 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/vars.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/wp-includes/vars.php b/wp-includes/vars.php index c8f085b813..cd0eef81ad 100644 --- a/wp-includes/vars.php +++ b/wp-includes/vars.php @@ -37,16 +37,20 @@ $wp_htmltranswinuni = array( '' => '', 'ž' => '', 'Ÿ' => 'Ÿ' -); + ); // On which page are we ? $PHP_SELF = $_SERVER['PHP_SELF']; -$pagenow = explode('/', $PHP_SELF); -$pagenow = trim($pagenow[(sizeof($pagenow)-1)]); -$pagenow = explode('?', $pagenow); -$pagenow = $pagenow[0]; -if (($querystring_start == '/') && ($pagenow != 'post.php')) { - $pagenow = get_settings('siteurl') . '/' . get_settings('blogfilename'); +if (preg_match('#([^/]+.php)#', $PHP_SELF, $self_matches)) { + $pagenow = $self_matches[1]; +} else { + $pagenow = explode('/', $PHP_SELF); + $pagenow = trim($pagenow[(sizeof($pagenow)-1)]); + $pagenow = explode('?', $pagenow); + $pagenow = $pagenow[0]; + if (($querystring_start == '/') && ($pagenow != 'post.php')) { + $pagenow = get_settings('siteurl') . '/' . get_settings('blogfilename'); + } } // Simple browser detection