4
0
Эх сурвалжийг харах

Suppress XML error during conversion attempt (#1909)

Using LIBXML_NOERROR. Seems to be necessary for newer PHP versions
because the at sign does not suppress warnings. In a FreshRSS-specific
SimplePie section.

Warning: DOMDocument::loadXML(): Namespace prefix media on content is
not defined in Entity, line: 42 in
/..../FreshRSS/lib/SimplePie/SimplePie/Parser.php on line 144
Alexandre Alapetite 7 жил өмнө
parent
commit
4c8f147238

+ 1 - 1
lib/SimplePie/SimplePie/Parser.php

@@ -141,7 +141,7 @@ class SimplePie_Parser
 				$dom = new DOMDocument();
 				$dom = new DOMDocument();
 				$dom->recover = true;
 				$dom->recover = true;
 				$dom->strictErrorChecking = false;
 				$dom->strictErrorChecking = false;
-				@$dom->loadXML($data);
+				@$dom->loadXML($data, LIBXML_NOERROR | LIBXML_NOWARNING);
 				$this->encoding = $encoding = $dom->encoding = 'UTF-8';
 				$this->encoding = $encoding = $dom->encoding = 'UTF-8';
 				$data2 = $dom->saveXML();
 				$data2 = $dom->saveXML();
 				if (function_exists('mb_convert_encoding'))
 				if (function_exists('mb_convert_encoding'))