r108248 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108247‎ | r108248 | r108249 >
Date:16:17, 6 January 2012
Author:hashar
Status:resolved
Tags:
Comment:
XCF: suppress warning on unpack + early exit on error

follow r108141
Modified paths:
  • /trunk/phase3/includes/media/XCF.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/media/XCF.php
@@ -78,6 +78,7 @@
7979 # 1: Grayscale
8080 # 2: Indexed color
8181 # (enum GimpImageBaseType in libgimpbase/gimpbaseenums.h)
 82+ wfSuppressWarnings();
8283 $header = unpack(
8384 "A9magic" # A: space padded
8485 . "/a5version" # a: zero padded
@@ -86,7 +87,12 @@
8788 . "/Nbase_type" # /
8889 , $binaryHeader
8990 );
 91+ wfRestoreWarnings();
9092
 93+ if( $header === false ) {
 94+ return false;
 95+ }
 96+
9197 # Check values
9298 if( $header['magic'] !== 'gimp xcf' ) {
9399 wfDebug( __METHOD__ . " '$filename' has invalid magic signature.\n" );

Follow-up revisions

RevisionCommit summaryAuthorDate
r108253Follow up r108248, r108141: use wfUnpack() so we don't duplicate logic. Could...demon16:58, 6 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r108141rewrite getXCFMetaData() to get ride of im identify...hashar14:48, 5 January 2012

Status & tagging log