r100362 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100361‎ | r100362 | r100363 >
Date:19:05, 20 October 2011
Author:aaron
Status:ok
Tags:
Comment:
More whitespace tweaks...and fixed doc typo
Modified paths:
  • /trunk/phase3/thumb.php (modified) (history)
  • /trunk/tools/upload-scripts/thumb-handler.php (modified) (history)

Diff [purge]

Index: trunk/phase3/thumb.php
@@ -46,7 +46,7 @@
4747 unset( $params['r'] ); // ignore 'r' because we unconditionally pass File::RENDER
4848
4949 // Is this a thumb of an archived file?
50 - $isOld = (isset( $params['archived'] ) && $params['archived']);
 50+ $isOld = ( isset( $params['archived'] ) && $params['archived'] );
5151 unset( $params['archived'] );
5252
5353 // Some basic input validation
@@ -182,7 +182,7 @@
183183 } else {
184184 header( 'HTTP/1.1 500 Internal server error' );
185185 }
186 - if( $wgShowHostnames ) {
 186+ if ( $wgShowHostnames ) {
187187 $url = htmlspecialchars( isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '' );
188188 $hostname = htmlspecialchars( wfHostname() );
189189 $debug = "<!-- $url -->\n<!-- $hostname -->\n";
Index: trunk/tools/upload-scripts/thumb-handler.php
@@ -3,13 +3,13 @@
44 # lighttpd puts the original request in REQUEST_URI, while
55 # sjs sets that to the 404 handler, and puts the original
66 # request in REDIRECT_URL.
7 -if (isset($_SERVER['REDIRECT_URL'])) {
 7+if ( isset( $_SERVER['REDIRECT_URL'] ) ) {
88 # The URL is un-encoded, so put it back how it was.
99 $uri = str_replace("%2F", "/", urlencode($_SERVER['REDIRECT_URL']));
1010 } else {
1111 $uri = $_SERVER['REQUEST_URI'];
1212 }
13 -
 13+
1414 # Is this a thumbnail?
1515 if ( preg_match('!^(?:http://upload.wikimedia.org)?/+([\w-]*)/([\w-]*)/thumb(/archive|/temp|)/\w/\w\w/([^/]*)/' .
1616 '(page(\d*)-)*(\d*)px-([^/]*)$!', $uri, $matches ) )
@@ -121,12 +121,11 @@
122122
123123 header( "X-Wikimedia-Thumb: $reqURL" );
124124
125 -
126125 $ch = curl_init( $reqURL );
127126 curl_setopt($ch, CURLOPT_PROXY, '10.2.1.21:80');
128127
129128 # Set an XFF header for abuse tracking
130 -# Use $_SERVER not apache_request_headers beccause this runs under fastcgi
 129+# Use $_SERVER not apache_request_headers because this runs under fastcgi
131130 if ( !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
132131 $xff = $_SERVER['HTTP_X_FORWARDED_FOR'] . ', ' . $_SERVER['REMOTE_ADDR'];
133132 } else {

Status & tagging log