From: Ariel T. Glenn Date: Thu, 13 Jun 2019 14:18:58 +0000 (+0300) Subject: when getting file (img) properties, suppress whines that it's not xml X-Git-Tag: 1.34.0-rc.0~1204^2 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=c9a05a70433ca420a52dd86eefd4feb4529d7e49;p=lhc%2Fweb%2Fwiklou.git when getting file (img) properties, suppress whines that it's not xml Imports eventually succeed but the log fills up with stack traces needlessly. Bug: T206013 Change-Id: Icb004954272ea8fc6fbc4fd5090cd1310d66946c --- diff --git a/includes/libs/mime/MimeAnalyzer.php b/includes/libs/mime/MimeAnalyzer.php index e7dc926b1e..f493769968 100644 --- a/includes/libs/mime/MimeAnalyzer.php +++ b/includes/libs/mime/MimeAnalyzer.php @@ -755,7 +755,9 @@ EOT; /** * look for XML formats (XHTML and SVG) */ + Wikimedia\suppressWarnings(); $xml = new XmlTypeCheck( $file ); + Wikimedia\restoreWarnings(); if ( $xml->wellFormed ) { $xmlTypes = $this->xmlTypes; return $xmlTypes[$xml->getRootElement()] ?? 'application/xml';