Code Duplication    Length = 9-10 lines in 2 locations

includes/media/XCF.php 1 location

@@ 220-228 (lines=9) @@
217
	 * @param File $file
218
	 * @return bool
219
	 */
220
	public function canRender( $file ) {
221
		MediaWiki\suppressWarnings();
222
		$xcfMeta = unserialize( $file->getMetadata() );
223
		MediaWiki\restoreWarnings();
224
		if ( isset( $xcfMeta['colorType'] ) && $xcfMeta['colorType'] === 'index-coloured' ) {
225
			return false;
226
		}
227
		return parent::canRender( $file );
228
	}
229
}
230

includes/media/SVG.php 1 location

@@ 379-388 (lines=10) @@
376
		return serialize( $metadata );
377
	}
378
379
	function unpackMetadata( $metadata ) {
380
		MediaWiki\suppressWarnings();
381
		$unser = unserialize( $metadata );
382
		MediaWiki\restoreWarnings();
383
		if ( isset( $unser['version'] ) && $unser['version'] == self::SVG_METADATA_VERSION ) {
384
			return $unser;
385
		} else {
386
			return false;
387
		}
388
	}
389
390
	function getMetadataType( $image ) {
391
		return 'parsed-svg';