when getting file (img) properties, suppress whines that it's not xml
authorAriel T. Glenn <ariel@wikimedia.org>
Thu, 13 Jun 2019 14:18:58 +0000 (17:18 +0300)
committerArielGlenn <ariel@wikimedia.org>
Tue, 2 Jul 2019 05:02:23 +0000 (05:02 +0000)
Imports eventually succeed but the log fills up with stack traces
needlessly.

Bug: T206013
Change-Id: Icb004954272ea8fc6fbc4fd5090cd1310d66946c

includes/libs/mime/MimeAnalyzer.php

index e7dc926..f493769 100644 (file)
@@ -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';