Index: trunk/phase3/includes/WebRequest.php |
— | — | @@ -96,6 +96,16 @@ |
97 | 97 | // Raw PATH_INFO style |
98 | 98 | $matches = self::extractTitle( $path, "$wgScript/$1" ); |
99 | 99 | |
| 100 | + if( !$matches |
| 101 | + && isset( $_SERVER['SCRIPT_NAME'] ) |
| 102 | + && preg_match( '/\.php5?/', $_SERVER['SCRIPT_NAME'] ) ) |
| 103 | + { |
| 104 | + # Check for SCRIPT_NAME, we handle index.php explicitly |
| 105 | + # But we do have some other .php files such as img_auth.php |
| 106 | + # Don't let root article paths clober the parsing for them |
| 107 | + $matches = self::extractTitle( $path, $_SERVER['SCRIPT_NAME'] . "/$1" ); |
| 108 | + } |
| 109 | + |
100 | 110 | global $wgArticlePath; |
101 | 111 | if( !$matches && $wgArticlePath ) { |
102 | 112 | $matches = self::extractTitle( $path, $wgArticlePath ); |
Index: trunk/phase3/img_auth.php |
— | — | @@ -36,7 +36,8 @@ |
37 | 37 | |
38 | 38 | # Set action base paths so that WebRequest::getPathInfo() |
39 | 39 | # recognizes the "X" as the 'title' in ../image_auth/X urls. |
40 | | -$wgActionPaths[] = $_SERVER['SCRIPT_NAME']; |
| 40 | +$wgArticlePath = false; # Don't let a "/*" article path clober our action path |
| 41 | +$wgActionPaths = array( "$wgUploadPath/" ); |
41 | 42 | |
42 | 43 | wfImageAuthMain(); |
43 | 44 | wfLogProfilingData(); |
— | — | @@ -55,7 +56,11 @@ |
56 | 57 | |
57 | 58 | // Get the requested file path (source file or thumbnail) |
58 | 59 | $matches = WebRequest::getPathInfo(); |
59 | | - $path = $matches['title']; // path with leading '/' |
| 60 | + $path = $matches['title']; |
| 61 | + if ( $path && $path[0] !== '/' ) { |
| 62 | + // Make sure $path has a leading / |
| 63 | + $path = "/" . $path; |
| 64 | + } |
60 | 65 | |
61 | 66 | // Check for bug 28235: QUERY_STRING overriding the correct extension |
62 | 67 | $whitelist = array(); |