Index: trunk/tools/upload-scripts/thumb-handler.php |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | $uri = $_SERVER['REQUEST_URI']; |
5 | 5 | |
6 | 6 | # Is this a thumbnail? |
7 | | -if ( preg_match('!^(?:http://upload.wikimedia.org)?/([\w-]*)/([\w-]*)/thumb/\w/\w\w/([^/]*)/' . |
| 7 | +if ( preg_match('!^(?:http://upload.wikimedia.org)?/([\w-]*)/([\w-]*)/thumb(/archive|)/\w/\w\w/([^/]*)/' . |
8 | 8 | '(page(\d*)-)*(\d*)px-([^/]*)$!', $uri, $matches ) ) |
9 | 9 | { |
10 | 10 | list( $all, $site, $lang, $filename, $pagefull, $pagenum, $size, $fn2 ) = $matches; |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | if ( $pagenum ) { |
16 | 16 | $params['page'] = $pagenum; |
17 | 17 | } |
18 | | -} elseif ( preg_match('!^(?:http://upload.wikimedia.org)?/([\w-]*)/([\w-]*)/thumb/\w/\w\w/([^/]*\.(?:(?i)ogg))/' . |
| 18 | +} elseif ( preg_match('!^(?:http://upload.wikimedia.org)?/([\w-]*)/([\w-]*)/thumb(/archive|)/\w/\w\w/([^/]*\.(?:(?i)ogg))/' . |
19 | 19 | '(mid|seek(?:=|%3D|%3d)\d+)-([^/]*)$!', $uri, $matches ) ) |
20 | 20 | { |
21 | 21 | list( $all, $site, $lang, $filename, $timeFull, $fn2 ) = $matches; |
— | — | @@ -187,7 +187,7 @@ |
188 | 188 | curl_close( $ch ); |
189 | 189 | |
190 | 190 | function pathFromUrl( $url ) { |
191 | | - if( preg_match( '!^(?:http://upload.wikimedia.org)?/([\w-]*)/([\w-]*)/thumb/(\w)/(\w\w)/([^/]*)/([^/]*)$!', |
| 191 | + if( preg_match( '!^(?:http://upload.wikimedia.org)?/([\w-]*)/([\w-]*)/thumb(/archive|)/(\w)/(\w\w)/([^/]*)/([^/]*)$!', |
192 | 192 | $url, $matches ) ) { |
193 | 193 | $parts = array_map( 'rawurldecode', $matches ); |
194 | 194 | list( $all, $site, $lang, $hash1, $hash2, $filename, $fn2 ) = $parts; |