r71785 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71784‎ | r71785 | r71786 >
Date:09:12, 27 August 2010
Author:tstarling
Status:deferred
Tags:
Comment:
Support for PagedTiffHandler. Committing for test on server.
Modified paths:
  • /trunk/tools/upload-scripts/thumb-handler.php (modified) (history)

Diff [purge]

Index: trunk/tools/upload-scripts/thumb-handler.php
@@ -25,9 +25,11 @@
2626 if ( $arch ) {
2727 $params['archived'] = 1;
2828 }
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))/' .
3031 '(mid|seek(?:=|%3D|%3d)[0-9.]+)-([^/]*)$!', $uri, $matches ) )
3132 {
 33+ # OggHandler
3234 list( $all, $site, $lang, $arch, $filename, $timeFull, $fn2 ) = $matches;
3335 $params = array( 'f' => $filename );
3436 if ( $timeFull != 'mid' ) {
@@ -37,6 +39,21 @@
3840 if ( $arch ) {
3941 $params['archived'] = 1;
4042 }
 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+ }
4158 } else {
4259 # No, display standard 404
4360 header( 'X-Debug: no regex match' );

Status & tagging log