Kill mysql4 specific code from DatabaseMysql
[lhc/web/wiklou.git] / thumb.php
index dfbd4a3..0bb0b60 100644 (file)
--- a/thumb.php
+++ b/thumb.php
@@ -26,10 +26,12 @@ function wfThumbMain() {
        $headers = array();
 
        // Get input parameters
-       if ( get_magic_quotes_gpc() ) {
-               $params = array_map( 'stripslashes', $_REQUEST );
+       if ( defined( 'THUMB_HANDLER' ) ) {
+               $params = $_REQUEST; // called from thumb_handler.php
        } else {
-               $params = $_REQUEST;
+               $params = get_magic_quotes_gpc()
+                       ? array_map( 'stripslashes', $_REQUEST )
+                       : $_REQUEST;
        }
 
        $fileName = isset( $params['f'] ) ? $params['f'] : '';
@@ -46,7 +48,7 @@ function wfThumbMain() {
        unset( $params['r'] ); // ignore 'r' because we unconditionally pass File::RENDER
 
        // Is this a thumb of an archived file?
-       $isOld = (isset( $params['archived'] ) && $params['archived']);
+       $isOld = ( isset( $params['archived'] ) && $params['archived'] );
        unset( $params['archived'] );
 
        // Some basic input validation
@@ -182,7 +184,7 @@ function wfThumbError( $status, $msg ) {
        } else {
                header( 'HTTP/1.1 500 Internal server error' );
        }
-       if( $wgShowHostnames ) {
+       if ( $wgShowHostnames ) {
                $url = htmlspecialchars( isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '' );
                $hostname = htmlspecialchars( wfHostname() );
                $debug = "<!-- $url -->\n<!-- $hostname -->\n";