Index: trunk/phase3/includes/WebRequest.php |
— | — | @@ -55,7 +55,21 @@ |
56 | 56 | $this->data = $_POST + $_GET; |
57 | 57 | } |
58 | 58 | |
| 59 | + /** |
| 60 | + * Extract the PATH_INFO variable even when it isn't a reasonable |
| 61 | + * value. On some large webhosts, PATH_INFO includes the script |
| 62 | + * path as well as everything after it. |
| 63 | + * |
| 64 | + * @param $want string: If this is not 'all', then the function |
| 65 | + * will return an empty array if it determines that the URL is |
| 66 | + * inside a rewrite path. |
| 67 | + * |
| 68 | + * @return Array: 'title' key is the title of the article. |
| 69 | + */ |
59 | 70 | static public function getPathInfo( $want = 'all' ) { |
| 71 | + // PATH_INFO is mangled due to http://bugs.php.net/bug.php?id=31892 |
| 72 | + // And also by Apache 2.x, double slashes are converted to single slashes. |
| 73 | + // So we will use REQUEST_URI if possible. |
60 | 74 | $matches = array(); |
61 | 75 | if ( !empty( $_SERVER['REQUEST_URI'] ) ) { |
62 | 76 | // Slurp out the path portion to examine... |
— | — | @@ -125,9 +139,11 @@ |
126 | 140 | return; |
127 | 141 | } |
128 | 142 | |
129 | | - $matches = self::getPathInfo( 'title' ); |
130 | | - foreach( $matches as $key => $val) { |
131 | | - $this->data[$key] = $_GET[$key] = $_REQUEST[$key] = $val; |
| 143 | + if ( $wgUsePathInfo ) { |
| 144 | + $matches = self::getPathInfo( 'title' ); |
| 145 | + foreach( $matches as $key => $val) { |
| 146 | + $this->data[$key] = $_GET[$key] = $_REQUEST[$key] = $val; |
| 147 | + } |
132 | 148 | } |
133 | 149 | } |
134 | 150 | |