From: Jack Phoenix Date: Fri, 29 Mar 2019 17:49:36 +0000 (+0200) Subject: Use isset() to avoid an E_NOTICE about an undefined index X-Git-Tag: 1.34.0-rc.0~2243^2 X-Git-Url: http://git.cyclocoop.org/data/%24self?a=commitdiff_plain;h=c7c2637bbd3aa296e52171dd09c8effe2b9b28cd;p=lhc%2Fweb%2Fwiklou.git Use isset() to avoid an E_NOTICE about an undefined index Change-Id: Ida990c474a7e4269dc2df989232eea5cb7b83345 --- diff --git a/includes/media/GIFHandler.php b/includes/media/GIFHandler.php index 556e83c960..9ef37fbee7 100644 --- a/includes/media/GIFHandler.php +++ b/includes/media/GIFHandler.php @@ -86,8 +86,11 @@ class GIFHandler extends BitmapHandler { $ser = $image->getMetadata(); if ( $ser ) { $metadata = unserialize( $ser ); - - return $image->getWidth() * $image->getHeight() * $metadata['frameCount']; + if ( isset( $metadata['frameCount'] ) && $metadata['frameCount'] > 0 ) { + return $image->getWidth() * $image->getHeight() * $metadata['frameCount']; + } else { + return $image->getWidth() * $image->getHeight(); + } } else { return $image->getWidth() * $image->getHeight(); } @@ -101,7 +104,7 @@ class GIFHandler extends BitmapHandler { $ser = $image->getMetadata(); if ( $ser ) { $metadata = unserialize( $ser ); - if ( $metadata['frameCount'] > 1 ) { + if ( isset( $metadata['frameCount'] ) && $metadata['frameCount'] > 1 ) { return true; } }