Index: trunk/phase3/thumb.php |
— | — | @@ -46,7 +46,7 @@ |
47 | 47 | unset( $params['r'] ); // ignore 'r' because we unconditionally pass File::RENDER |
48 | 48 | |
49 | 49 | // Is this a thumb of an archived file? |
50 | | - $isOld = (isset( $params['archived'] ) && $params['archived']); |
| 50 | + $isOld = ( isset( $params['archived'] ) && $params['archived'] ); |
51 | 51 | unset( $params['archived'] ); |
52 | 52 | |
53 | 53 | // Some basic input validation |
— | — | @@ -182,7 +182,7 @@ |
183 | 183 | } else { |
184 | 184 | header( 'HTTP/1.1 500 Internal server error' ); |
185 | 185 | } |
186 | | - if( $wgShowHostnames ) { |
| 186 | + if ( $wgShowHostnames ) { |
187 | 187 | $url = htmlspecialchars( isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '' ); |
188 | 188 | $hostname = htmlspecialchars( wfHostname() ); |
189 | 189 | $debug = "<!-- $url -->\n<!-- $hostname -->\n"; |
Index: trunk/tools/upload-scripts/thumb-handler.php |
— | — | @@ -3,13 +3,13 @@ |
4 | 4 | # lighttpd puts the original request in REQUEST_URI, while |
5 | 5 | # sjs sets that to the 404 handler, and puts the original |
6 | 6 | # request in REDIRECT_URL. |
7 | | -if (isset($_SERVER['REDIRECT_URL'])) { |
| 7 | +if ( isset( $_SERVER['REDIRECT_URL'] ) ) { |
8 | 8 | # The URL is un-encoded, so put it back how it was. |
9 | 9 | $uri = str_replace("%2F", "/", urlencode($_SERVER['REDIRECT_URL'])); |
10 | 10 | } else { |
11 | 11 | $uri = $_SERVER['REQUEST_URI']; |
12 | 12 | } |
13 | | - |
| 13 | + |
14 | 14 | # Is this a thumbnail? |
15 | 15 | if ( preg_match('!^(?:http://upload.wikimedia.org)?/+([\w-]*)/([\w-]*)/thumb(/archive|/temp|)/\w/\w\w/([^/]*)/' . |
16 | 16 | '(page(\d*)-)*(\d*)px-([^/]*)$!', $uri, $matches ) ) |
— | — | @@ -121,12 +121,11 @@ |
122 | 122 | |
123 | 123 | header( "X-Wikimedia-Thumb: $reqURL" ); |
124 | 124 | |
125 | | - |
126 | 125 | $ch = curl_init( $reqURL ); |
127 | 126 | curl_setopt($ch, CURLOPT_PROXY, '10.2.1.21:80'); |
128 | 127 | |
129 | 128 | # 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 |
131 | 130 | if ( !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { |
132 | 131 | $xff = $_SERVER['HTTP_X_FORWARDED_FOR'] . ', ' . $_SERVER['REMOTE_ADDR']; |
133 | 132 | } else { |