http://www.mediawiki.org/wiki/Special:Code/MediaWiki/100362
Revision: 100362 Author: aaron Date: 2011-10-20 19:05:48 +0000 (Thu, 20 Oct 2011) Log Message: ----------- More whitespace tweaks...and fixed doc typo Modified Paths: -------------- trunk/phase3/thumb.php trunk/tools/upload-scripts/thumb-handler.php Modified: trunk/phase3/thumb.php =================================================================== --- trunk/phase3/thumb.php 2011-10-20 19:01:08 UTC (rev 100361) +++ trunk/phase3/thumb.php 2011-10-20 19:05:48 UTC (rev 100362) @@ -46,7 +46,7 @@ unset( $params['r'] ); // ignore 'r' because we unconditionally pass File::RENDER // Is this a thumb of an archived file? - $isOld = (isset( $params['archived'] ) && $params['archived']); + $isOld = ( isset( $params['archived'] ) && $params['archived'] ); unset( $params['archived'] ); // Some basic input validation @@ -182,7 +182,7 @@ } else { header( 'HTTP/1.1 500 Internal server error' ); } - if( $wgShowHostnames ) { + if ( $wgShowHostnames ) { $url = htmlspecialchars( isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '' ); $hostname = htmlspecialchars( wfHostname() ); $debug = "<!-- $url -->\n<!-- $hostname -->\n"; Modified: trunk/tools/upload-scripts/thumb-handler.php =================================================================== --- trunk/tools/upload-scripts/thumb-handler.php 2011-10-20 19:01:08 UTC (rev 100361) +++ trunk/tools/upload-scripts/thumb-handler.php 2011-10-20 19:05:48 UTC (rev 100362) @@ -3,13 +3,13 @@ # lighttpd puts the original request in REQUEST_URI, while # sjs sets that to the 404 handler, and puts the original # request in REDIRECT_URL. -if (isset($_SERVER['REDIRECT_URL'])) { +if ( isset( $_SERVER['REDIRECT_URL'] ) ) { # The URL is un-encoded, so put it back how it was. $uri = str_replace("%2F", "/", urlencode($_SERVER['REDIRECT_URL'])); } else { $uri = $_SERVER['REQUEST_URI']; } - + # Is this a thumbnail? if ( preg_match('!^(?:http://upload.wikimedia.org)?/+([\w-]*)/([\w-]*)/thumb(/archive|/temp|)/\w/\w\w/([^/]*)/' . '(page(\d*)-)*(\d*)px-([^/]*)$!', $uri, $matches ) ) @@ -121,12 +121,11 @@ header( "X-Wikimedia-Thumb: $reqURL" ); - $ch = curl_init( $reqURL ); curl_setopt($ch, CURLOPT_PROXY, '10.2.1.21:80'); # Set an XFF header for abuse tracking -# Use $_SERVER not apache_request_headers beccause this runs under fastcgi +# Use $_SERVER not apache_request_headers because this runs under fastcgi if ( !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { $xff = $_SERVER['HTTP_X_FORWARDED_FOR'] . ', ' . $_SERVER['REMOTE_ADDR']; } else { _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs