From 5233912627d370d8a346a810cc95c46554a4a8e1 Mon Sep 17 00:00:00 2001 From: andi Date: Sat, 21 May 2005 12:49:30 +0200 Subject: fix for internal rewrites #332 darcs-hash:20050521104930-9977f-f93dd746cbb3db2ebda43a044198c2eb0aa4152b.gz --- inc/pageutils.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/inc/pageutils.php b/inc/pageutils.php index fdece44e4..731c3415c 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -34,9 +34,12 @@ function getID(){ $script = $_SERVER['SCRIPT_NAME']; } + //clean script and request (fixes a windows problem) + $script = preg_replace('/\/\/+/','/',$script); + $request = preg_replace('/\/\/+/','/',$_SERVER['REQUEST_URI']); + //remove script URL and Querystring to gain the id - if(preg_match('/^'.preg_quote($script,'/').'(.*)/', - $_SERVER['REQUEST_URI'], $match)){ + if(preg_match('/^'.preg_quote($script,'/').'(.*)/',$request, $match)){ $id = preg_replace ('/\?.*/','',$match[1]); } $id = cleanID($id); -- cgit v1.2.3