r42801 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r42800‎ | r42801 | r42802 >
Date:04:34, 30 October 2008
Author:river
Status:old
Tags:
Comment:
if REDIRECT_URL is set, prefer it to REQUEST_URI. lighttpd doesn't set this, so its behaviour is unchanged
Modified paths:
  • /trunk/tools/upload-scripts/thumb-handler.php (modified) (history)

Diff [purge]

Index: trunk/tools/upload-scripts/thumb-handler.php
@@ -1,6 +1,13 @@
22 <?php
33
4 -$uri = $_SERVER['REQUEST_URI'];
 4+# lighttpd puts the original request in REQUEST_URI, while
 5+# sjs sets that to the 404 handler, and puts the original
 6+# request in REDIRECT_URL.
 7+if (isset($_SERVER['REDIRECT_URL'])) {
 8+ $uri = $_SERVER['REDIRECT_URL'];
 9+} else {
 10+ $uri = $_SERVER['REQUEST_URI'];
 11+}
512
613 # Is this a thumbnail?
714 if ( preg_match('!^(?:http://upload.wikimedia.org)?/([\w-]*)/([\w-]*)/thumb(/archive|)/\w/\w\w/([^/]*)/' .
@@ -186,7 +193,7 @@
187194 $uname = posix_uname();
188195 $server = $uname['nodename'];
189196 if ( !in_array($server, array('amane.pmtpa.wmnet', 'storage1', 'ms1', 'ms2')) ) {
190 - $dest = pathFromUrl( $_SERVER['REQUEST_URI'] );
 197+ $dest = pathFromUrl( $uri );
191198 if( $dest ) {
192199 if ( strpos( $dest, '..' ) === false ) {
193200 # Make directory and parents

Status & tagging log