r39256 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39255‎ | r39256 | r39257 >
Date:00:30, 13 August 2008
Author:aaron
Status:old
Tags:
Comment:
Add (/archive|)
Modified paths:
  • /trunk/tools/upload-scripts/thumb-handler.php (modified) (history)

Diff [purge]

Index: trunk/tools/upload-scripts/thumb-handler.php
@@ -3,7 +3,7 @@
44 $uri = $_SERVER['REQUEST_URI'];
55
66 # 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/([^/]*)/' .
88 '(page(\d*)-)*(\d*)px-([^/]*)$!', $uri, $matches ) )
99 {
1010 list( $all, $site, $lang, $filename, $pagefull, $pagenum, $size, $fn2 ) = $matches;
@@ -14,7 +14,7 @@
1515 if ( $pagenum ) {
1616 $params['page'] = $pagenum;
1717 }
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))/' .
1919 '(mid|seek(?:=|%3D|%3d)\d+)-([^/]*)$!', $uri, $matches ) )
2020 {
2121 list( $all, $site, $lang, $filename, $timeFull, $fn2 ) = $matches;
@@ -187,7 +187,7 @@
188188 curl_close( $ch );
189189
190190 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)/([^/]*)/([^/]*)$!',
192192 $url, $matches ) ) {
193193 $parts = array_map( 'rawurldecode', $matches );
194194 list( $all, $site, $lang, $hash1, $hash2, $filename, $fn2 ) = $parts;

Status & tagging log