https://www.mediawiki.org/wiki/Special:Code/MediaWiki/108248

Revision: 108248
Author:   hashar
Date:     2012-01-06 16:17:04 +0000 (Fri, 06 Jan 2012)
Log Message:
-----------
XCF: suppress warning on unpack + early exit on error

follow r108141

Modified Paths:
--------------
    trunk/phase3/includes/media/XCF.php

Modified: trunk/phase3/includes/media/XCF.php
===================================================================
--- trunk/phase3/includes/media/XCF.php 2012-01-06 16:12:53 UTC (rev 108247)
+++ trunk/phase3/includes/media/XCF.php 2012-01-06 16:17:04 UTC (rev 108248)
@@ -78,6 +78,7 @@
                #                         1: Grayscale
                #                         2: Indexed color
                #        (enum GimpImageBaseType in libgimpbase/gimpbaseenums.h)
+               wfSuppressWarnings();
                $header = unpack(
                          "A9magic"     # A: space padded
                        . "/a5version"  # a: zero padded
@@ -86,7 +87,12 @@
                        . "/Nbase_type" # /
                , $binaryHeader
                );
+               wfRestoreWarnings();
 
+               if( $header === false ) {
+                       return false;
+               }
+
                # Check values
                if( $header['magic'] !== 'gimp xcf' ) {
                        wfDebug( __METHOD__ . " '$filename' has invalid magic 
signature.\n" );


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to