ContentHandler: Fix a typo
[lhc/web/wiklou.git] / thumb.php
index f59ee0f..4a0c9fb 100644 (file)
--- a/thumb.php
+++ b/thumb.php
  */
 
 define( 'MW_NO_OUTPUT_COMPRESSION', 1 );
-if ( isset( $_SERVER['MW_COMPILED'] ) ) {
-       require( 'core/includes/WebStart.php' );
-} else {
-       require( __DIR__ . '/includes/WebStart.php' );
-}
+require __DIR__ . '/includes/WebStart.php';
 
 // Don't use fancy mime detection, just check the file extension for jpg/gif/png
 $wgTrivialMimeDetection = true;
@@ -126,7 +122,7 @@ function wfStreamThumb( array $params ) {
                $img = new UnregisteredLocalFile( null, $repo,
                        # Temp files are hashed based on the name without the timestamp.
                        # The thumbnails will be hashed based on the entire name however.
-                       # @TODO: fix this convention to actually be reasonable.
+                       # @todo fix this convention to actually be reasonable.
                        $repo->getZonePath( 'public' ) . '/' . $repo->getTempHashPath( $fileName ) . $fileName
                );
        } elseif ( $isOld ) {
@@ -170,11 +166,11 @@ function wfStreamThumb( array $params ) {
 
        // Check the source file storage path
        if ( !$img->exists() ) {
-               wfThumbError( 404, 'The source file for the specified thumbnail does not exist.' );
+               wfThumbError( 404, "The source file '$fileName' does not exist." );
                wfProfileOut( __METHOD__ );
                return;
        } elseif ( $img->getPath() === false ) {
-               wfThumbError( 500, 'The source file is not locally accessible.' );
+               wfThumbError( 500, "The source file '$fileName' is not locally accessible." );
                wfProfileOut( __METHOD__ );
                return;
        }
@@ -224,7 +220,7 @@ function wfStreamThumb( array $params ) {
                        $response->header( 'Location: ' .
                                wfExpandUrl( $img->getThumbUrl( $thumbName ), PROTO_CURRENT ) );
                        $response->header( 'Expires: ' .
-                               gmdate( 'D, d M Y H:i:s', time() + 7*86400 ) . ' GMT' );
+                               gmdate( 'D, d M Y H:i:s', time() + 7 * 86400 ) . ' GMT' );
                        if ( $wgVaryOnXFP ) {
                                $varyHeader[] = 'X-Forwarded-Proto';
                        }
@@ -364,7 +360,7 @@ function wfThumbError( $status, $msg ) {
                $hostname = htmlspecialchars( wfHostname() );
                $debug = "<!-- $url -->\n<!-- $hostname -->\n";
        } else {
-               $debug = "";
+               $debug = '';
        }
        echo <<<EOT
 <html><head><title>Error generating thumbnail</title></head>