(bug 2139) Show page title in subtitle when viewing "read only" page
[lhc/web/wiklou.git] / thumb.php
index ff84d89..9f5eeba 100644 (file)
--- a/thumb.php
+++ b/thumb.php
@@ -1,13 +1,18 @@
 <?php
 
-/** 
- * PHP script to stream out an image thumbnail. 
- * If the file exists, we make do with abridged MediaWiki initialisation. 
+/**
+ * PHP script to stream out an image thumbnail.
+ * If the file exists, we make do with abridged MediaWiki initialisation.
  */
 
 define( 'MEDIAWIKI', true );
 unset( $IP );
-$wgNoOutputBuffer = true;
+if ( isset( $_REQUEST['GLOBALS'] ) ) {
+       echo '<a href="http://www.hardened-php.net/index.76.html">$GLOBALS overwrite vulnerability</a>';
+       die( -1 );
+}
+
+define( 'MW_NO_OUTPUT_BUFFER', true );
 
 require_once( './includes/Defines.php' );
 require_once( './LocalSettings.php' );
@@ -44,13 +49,14 @@ if ( $pre_render ) {
 }
 $thumbPath = wfImageThumbDir( $fileName ) . '/' . $thumbName;
 
-if ( file_exists( $thumbPath ) && filemtime( $thumbPath ) >= filemtime( $imagePath ) ) {
+if ( is_file( $thumbPath ) && filemtime( $thumbPath ) >= filemtime( $imagePath ) ) {
        wfStreamFile( $thumbPath );
        exit;
 }
 
 // OK, no valid thumbnail, time to get out the heavy machinery
 require_once( 'Setup.php' );
+wfProfileIn( 'thumb.php' );
 
 $img = Image::newFromName( $fileName );
 if ( $img ) {
@@ -72,5 +78,7 @@ if ( $thumb && $thumb->path ) {
 </body></html>";
 }
 
+wfProfileOut( 'thumb.php' );
+
 
 ?>