The fix introduced in revision
7d71d4b7 seems to cause problems on certain system. I've experienced problems with Apache/CGI/PHP 5.3.
The involved variables are set as follows:
'DOCUMENT_ROOT' /var/www/vhosts/example.com/htdocs
'PATH_TRANSLATED' /var/www/vhosts/example.com/htdocs/doku.php
'REQUEST_URI' /doku.php/test
'SCRIPT_FILENAME' /var/www/vhosts/example.com/htdocs/doku.php
'SCRIPT_NAME' /phpinfo.php
Thus the "newly" introduced elseif in inc/pageutils.php is taken, $request is set to doku.php, $script remains unset. The regex in line 54 of inc/pageutils.php thus matches the whole $request, that means doku.php is taken as page id, I saw that in DokuWiki itself, too. Removing that elseif clause resolved the problem. Ironically that elseif was a fix for a problem I reported...
Below a testcase that contains the reported values:
From
6fcf7fe2 Mon Sep 17 00:00:00 2001
From: Michael Hamann <
michael@content-space.de>
Date: Sat, 27 Feb 2010 19:31:01 +0100
Subject: [PATCH] Added new testcase for getID with Apache/CGI
---
_test/cases/inc/pageutils_getid.test.php | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/_test/cases/inc/pageutils_getid.test.php b/_test/cases/inc/pageutils_getid.test.php
index 8233ffb..14a21ca 100644
--- a/_test/cases/inc/pageutils_getid.test.php
+++ b/_test/cases/inc/pageutils_getid.test.php
@@ -64,5 +64,24 @@ class init_getID_test extends UnitTestCase {
$this->assertEqual(getID(), 'wiki:dokuwiki');
}
+ /**
+ * getID with given id in url and userewrite=2, no basedir set, Apache and CGI.
+ */
+ function test4() {
+ global $conf;
+ $conf['basedir'] = '';
+ $conf['userewrite'] = '2';
+ $conf['baseurl'] = '';
+ $_SERVER['DOCUMENT_ROOT'] = '/var/www/vhosts/example.com/htdocs';
+ $_SERVER['SCRIPT_FILENAME'] = '/var/www/vhosts/example.com/htdocs/doku.php';
+ $_SERVER['SCRIPT_NAME'] = '/doku.php';
+ $_SERVER['REQUEST_URI'] = '/doku.php/wiki/dokuwiki';
+ $_SERVER['PATH_INFO'] = '/test/dokuwiki';
+ $_SERVER['PATH_TRANSLATED'] = '/var/www/vhosts/example.com/htdocs/doku.php';
+ $_SERVER['PHP_SELF'] = '/doku.php/wiki/dokuwiki';
+
+ $this->assertEqual(getID(), 'wiki:dokuwiki');
+ }
+
}
//Setup VIM: ex: et ts=4 enc=utf-8 :
--
1.7.0