r17097 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r17096‎ | r17097 | r17098 >
Date:00:56, 19 October 2006
Author:tstarling
Status:old
Tags:
Comment:
Experimental workaround for http://bugs.php.net/bug.php?id=31892 , will be tested shortly.
Modified paths:
  • /trunk/phase3/includes/WebRequest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/WebRequest.php
@@ -47,10 +47,15 @@
4848 function WebRequest() {
4949 $this->checkMagicQuotes();
5050 global $wgUsePathInfo;
51 - if( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != '') && $wgUsePathInfo ) {
52 - # Stuff it!
53 - $_GET['title'] = $_REQUEST['title'] =
54 - substr( $_SERVER['PATH_INFO'], 1 );
 51+ if ( $wgUsePathInfo ) {
 52+ if ( isset( $_SERVER['ORIG_PATH_INFO'] ) && $_SERVER['ORIG_PATH_INFO'] != '' ) {
 53+ # Mangled PATH_INFO
 54+ # http://bugs.php.net/bug.php?id=31892
 55+ # Also reported when ini_get('cgi.fix_pathinfo')==false
 56+ $_GET['title'] = $_REQUEST['title'] = substr( $_SERVER['ORIG_PATH_INFO'], 1 );
 57+ } elseif ( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != '') && $wgUsePathInfo ) {
 58+ $_GET['title'] = $_REQUEST['title'] = substr( $_SERVER['PATH_INFO'], 1 );
 59+ }
5560 }
5661 }
5762