Index: trunk/phase3/includes/WebRequest.php |
— | — | @@ -46,31 +46,14 @@ |
47 | 47 | $this->checkMagicQuotes(); |
48 | 48 | global $wgUsePathInfo; |
49 | 49 | 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'] != '' ) { |
67 | 51 | # Mangled PATH_INFO |
68 | 52 | # http://bugs.php.net/bug.php?id=31892 |
69 | 53 | # 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 ); |
71 | 55 | } 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 ); |
73 | 57 | } |
74 | | - $_GET['title'] = $_REQUEST['title'] = $title; |
75 | 58 | } |
76 | 59 | } |
77 | 60 | |