r22126 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22125‎ | r22126 | r22127 >
Date:17:46, 12 May 2007
Author:aaron
Status:old
Tags:
Comment:
*Revert r22121, causes a lot of stuff to redirect to main page for no reason, clicking history/edit tabs results in "Editing Main Page" no matter what (Apache/2.2.3_)
Modified paths:
  • /trunk/phase3/includes/WebRequest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/WebRequest.php
@@ -46,31 +46,14 @@
4747 $this->checkMagicQuotes();
4848 global $wgUsePathInfo;
4949 if ( $wgUsePathInfo ) {
50 - // PATH_INFO is mangled due to http://bugs.php.net/bug.php?id=31892
51 - // And also by Apache 2.x, double slashes are converted to single slashes.
52 - // So we will use REQUEST_URI if possible.
53 - $title = '';
54 - if ( !empty( $_SERVER['REQUEST_URI'] ) ) {
55 - global $wgArticlePath;
56 - $url = $_SERVER['REQUEST_URI'];
57 - if ( !preg_match( '!^https?://!', $url ) ) {
58 - $url = 'http://unused' . $url;
59 - }
60 - $a = parse_url( $url );
61 - // Find the part after $wgArticlePath
62 - $base = str_replace( '$1', '', $wgArticlePath );
63 - if ( $a && substr( $a['path'], 0, strlen( $base ) ) == $base ) {
64 - $title = substr( $a['path'], strlen( $base ) );
65 - }
66 - } elseif ( isset( $_SERVER['ORIG_PATH_INFO'] ) && $_SERVER['ORIG_PATH_INFO'] != '' ) {
 50+ if ( isset( $_SERVER['ORIG_PATH_INFO'] ) && $_SERVER['ORIG_PATH_INFO'] != '' ) {
6751 # Mangled PATH_INFO
6852 # http://bugs.php.net/bug.php?id=31892
6953 # Also reported when ini_get('cgi.fix_pathinfo')==false
70 - $title = substr( $_SERVER['ORIG_PATH_INFO'], 1 );
 54+ $_GET['title'] = $_REQUEST['title'] = substr( $_SERVER['ORIG_PATH_INFO'], 1 );
7155 } elseif ( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != '') && $wgUsePathInfo ) {
72 - $title = substr( $_SERVER['PATH_INFO'], 1 );
 56+ $_GET['title'] = $_REQUEST['title'] = substr( $_SERVER['PATH_INFO'], 1 );
7357 }
74 - $_GET['title'] = $_REQUEST['title'] = $title;
7558 }
7659 }
7760

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r22121Use $_SERVER['REQUEST_URI'] instead of $_SERVER['PATH_INFO'], because Apache ...tstarling15:44, 12 May 2007