From: Tim Starling Date: Thu, 19 Oct 2006 00:56:57 +0000 (+0000) Subject: Experimental workaround for http://bugs.php.net/bug.php?id=31892 , will be tested... X-Git-Tag: 1.31.0-rc.0~55437 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=9b5d01864327be6052ddc04248648b29aa38b289;p=lhc%2Fweb%2Fwiklou.git Experimental workaround for bugs.php.net/bug.php?id=31892 , will be tested shortly. --- diff --git a/includes/WebRequest.php b/includes/WebRequest.php index 32307ed2eb..353369547e 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -47,10 +47,15 @@ class WebRequest { function WebRequest() { $this->checkMagicQuotes(); global $wgUsePathInfo; - if( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != '') && $wgUsePathInfo ) { - # Stuff it! - $_GET['title'] = $_REQUEST['title'] = - substr( $_SERVER['PATH_INFO'], 1 ); + if ( $wgUsePathInfo ) { + if ( isset( $_SERVER['ORIG_PATH_INFO'] ) && $_SERVER['ORIG_PATH_INFO'] != '' ) { + # Mangled PATH_INFO + # http://bugs.php.net/bug.php?id=31892 + # Also reported when ini_get('cgi.fix_pathinfo')==false + $_GET['title'] = $_REQUEST['title'] = substr( $_SERVER['ORIG_PATH_INFO'], 1 ); + } elseif ( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != '') && $wgUsePathInfo ) { + $_GET['title'] = $_REQUEST['title'] = substr( $_SERVER['PATH_INFO'], 1 ); + } } }