Index: trunk/phase3/thumb_handler.php |
— | — | @@ -3,41 +3,6 @@ |
4 | 4 | # Valid web server entry point |
5 | 5 | define( 'THUMB_HANDLER', true ); |
6 | 6 | |
7 | | -if ( $_SERVER['REQUEST_URI'] === $_SERVER['SCRIPT_NAME'] ) { |
8 | | - # Directly requesting this script is not a use case. |
9 | | - # Instead of giving a thumbnail error, give a generic 404. |
10 | | - wfDisplay404Error(); // go away, nothing to see here |
11 | | -} else { |
12 | | - # Execute thumb.php, having set THUMB_HANDLER so that |
13 | | - # it knows to extract params from a thumbnail file URL. |
14 | | - require( dirname( __FILE__ ) . '/thumb.php' ); |
15 | | -} |
16 | | - |
17 | | -/** |
18 | | - * Print out a generic 404 error message |
19 | | - * |
20 | | - * @return void |
21 | | - */ |
22 | | -function wfDisplay404Error() { |
23 | | - header( 'HTTP/1.1 404 Not Found' ); |
24 | | - header( 'Content-Type: text/html;charset=utf-8' ); |
25 | | - |
26 | | - $prot = isset( $_SERVER['HTTPS'] ) ? "https://" : "http://"; |
27 | | - $serv = strlen( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']; |
28 | | - $loc = $_SERVER["REQUEST_URI"]; |
29 | | - |
30 | | - $encUrl = htmlspecialchars( $prot . $serv . $loc ); |
31 | | - |
32 | | - // Looks like a typical apache2 error |
33 | | - $standard_404 = <<<ENDTEXT |
34 | | -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> |
35 | | -<html><head> |
36 | | -<title>404 Not Found</title> |
37 | | -</head><body> |
38 | | -<h1>Not Found</h1> |
39 | | -<p>The requested URL $encUrl was not found on this server.</p> |
40 | | -</body></html> |
41 | | -ENDTEXT; |
42 | | - |
43 | | - print $standard_404; |
44 | | -} |
| 7 | +# Execute thumb.php, having set THUMB_HANDLER so that |
| 8 | +# it knows to extract params from a thumbnail file URL. |
| 9 | +require( dirname( __FILE__ ) . '/thumb.php' ); |
Index: trunk/phase3/thumb.php |
— | — | @@ -8,9 +8,9 @@ |
9 | 9 | */ |
10 | 10 | define( 'MW_NO_OUTPUT_COMPRESSION', 1 ); |
11 | 11 | if ( isset( $_SERVER['MW_COMPILED'] ) ) { |
12 | | - require ( 'phase3/includes/WebStart.php' ); |
| 12 | + require( 'phase3/includes/WebStart.php' ); |
13 | 13 | } else { |
14 | | - require ( dirname( __FILE__ ) . '/includes/WebStart.php' ); |
| 14 | + require( dirname( __FILE__ ) . '/includes/WebStart.php' ); |
15 | 15 | } |
16 | 16 | |
17 | 17 | // Don't use fancy mime detection, just check the file extension for jpg/gif/png |