r39264 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39263‎ | r39264 | r39265 >
Date:01:32, 13 August 2008
Author:aaron
Status:old
Tags:
Comment:
lookaheads not captured of course! need more coffee
Modified paths:
  • /trunk/tools/upload-scripts/thumb-handler.php (modified) (history)

Diff [purge]

Index: trunk/tools/upload-scripts/thumb-handler.php
@@ -6,7 +6,7 @@
77 if ( preg_match('!^(?:http://upload.wikimedia.org)?/([\w-]*)/([\w-]*)/thumb(/archive|)/\w/\w\w/([^/]*)/' .
88 '(page(\d*)-)*(\d*)px-([^/]*)$!', $uri, $matches ) )
99 {
10 - list( $all, $site, $lang, $filename, $arch, $pagefull, $pagenum, $size, $fn2 ) = $matches;
 10+ list( $all, $site, $lang, $arch, $filename, $pagefull, $pagenum, $size, $fn2 ) = $matches;
1111 $params = array(
1212 'f' => $filename,
1313 'width' => $size
@@ -20,7 +20,7 @@
2121 } elseif ( preg_match('!^(?:http://upload.wikimedia.org)?/([\w-]*)/([\w-]*)/thumb(/archive|)/\w/\w\w/([^/]*\.(?:(?i)ogg))/' .
2222 '(mid|seek(?:=|%3D|%3d)\d+)-([^/]*)$!', $uri, $matches ) )
2323 {
24 - list( $all, $site, $lang, $filename, $arch, $timeFull, $fn2 ) = $matches;
 24+ list( $all, $site, $lang, $arch, $filename, $timeFull, $fn2 ) = $matches;
2525 $params = array( 'f' => $filename );
2626 if ( $timeFull != 'mid' ) {
2727 list( $seek, $thumbtime ) = explode( '=', urldecode( $timeFull ), 2 );
@@ -196,7 +196,7 @@
197197 if( preg_match( '!^(?:http://upload.wikimedia.org)?/([\w-]*)/([\w-]*)/thumb(/archive|)/(\w)/(\w\w)/([^/]*)/([^/]*)$!',
198198 $url, $matches ) ) {
199199 $parts = array_map( 'rawurldecode', $matches );
200 - list( $all, $site, $lang, $hash1, $arch, $hash2, $filename, $fn2 ) = $parts;
 200+ list( $all, $site, $lang, $arch, $hash1, $hash2, $filename, $fn2 ) = $parts;
201201
202202 $md5 = md5( $filename );
203203 if( $hash1 != substr( $md5, 0, 1 ) ) return false;

Status & tagging log