Index: trunk/tools/upload-scripts/thumb-handler.php |
— | — | @@ -25,9 +25,11 @@ |
26 | 26 | if ( $arch ) { |
27 | 27 | $params['archived'] = 1; |
28 | 28 | } |
29 | | -} elseif ( preg_match('!^(?:http://upload.wikimedia.org)?/+([\w-]*)/([\w-]*)/thumb(/archive|)/\w/\w\w/([^/]*\.(?:(?i)ogg|ogv|oga))/' . |
| 29 | +} elseif ( preg_match('!^(?:http://upload.wikimedia.org)?/+([\w-]*)/([\w-]*)/thumb(/archive|)/' . |
| 30 | + '\w/\w\w/([^/]*\.(?:(?i)ogg|ogv|oga))/' . |
30 | 31 | '(mid|seek(?:=|%3D|%3d)[0-9.]+)-([^/]*)$!', $uri, $matches ) ) |
31 | 32 | { |
| 33 | + # OggHandler |
32 | 34 | list( $all, $site, $lang, $arch, $filename, $timeFull, $fn2 ) = $matches; |
33 | 35 | $params = array( 'f' => $filename ); |
34 | 36 | if ( $timeFull != 'mid' ) { |
— | — | @@ -37,6 +39,21 @@ |
38 | 40 | if ( $arch ) { |
39 | 41 | $params['archived'] = 1; |
40 | 42 | } |
| 43 | +} elseif ( preg_match( '!^(?:http://upload.wikimedia.org)?/+([\w-]*)/([\w-]*)/thumb(/archive|)/' . |
| 44 | + '\w/\w\w/([^/]*\.(?:(?i)tiff|tif))/' . |
| 45 | + '(lossy|lossless)-page(\d+)-(\d+)px-([^/]*)$!', $uri, $matches ) ) |
| 46 | +{ |
| 47 | + # PagedTiffHandler |
| 48 | + list( $all, $site, $lang, $arch, $filename, $lossy, $pagenum, $size, $fn2 ) = $matches; |
| 49 | + $params = array( |
| 50 | + 'f' => $filename, |
| 51 | + 'lossy' => $lossy |
| 52 | + 'width' => $size, |
| 53 | + 'page' => $pagenum, |
| 54 | + ); |
| 55 | + if ( $arch ) { |
| 56 | + $params['archived'] = 1; |
| 57 | + } |
41 | 58 | } else { |
42 | 59 | # No, display standard 404 |
43 | 60 | header( 'X-Debug: no regex match' ); |