A free, self-hostable news aggregator…
Un morceau de tolérance XML oublié
Alexandre Alapetite316778ef4739
diff --git a/lib/SimplePie/SimplePie.php b/lib/SimplePie/SimplePie.phpindex b33c635f1..9e532023a 100644--- a/lib/SimplePie/SimplePie.php+++ b/lib/SimplePie/SimplePie.php@@ -1311,8 +1311,10 @@ class SimplePie{$encodings[] = strtoupper($charset[1]);}- $encodings = array_merge($encodings, $this->registry->call('Misc', 'xml_encoding', array($this->raw_data, &$this->registry)));- $encodings[] = 'UTF-8';+ else+ {+ $encodings[] = ''; //Let the DOM parser decide first+ }}elseif (in_array($sniffed, $text_types) || substr($sniffed, 0, 5) === 'text/' && substr($sniffed, -4) === '+xml'){@@ -1320,6 +1322,10 @@ class SimplePie{$encodings[] = $charset[1];}+ else+ {+ $encodings[] = '';+ }$encodings[] = 'US-ASCII';}// Text MIME-type default@@ -1341,7 +1347,7 @@ class SimplePieforeach ($encodings as $encoding){// Change the encoding to UTF-8 (as we always use UTF-8 internally)- if ($utf8_data = $this->registry->call('Misc', 'change_encoding', array($this->raw_data, $encoding, 'UTF-8')))+ if ($utf8_data = (empty($encoding) || $encoding === 'UTF-8') ? $this->raw_data : $this->registry->call('Misc', 'change_encoding', array($this->raw_data, $encoding, 'UTF-8'))){// Create new parser$parser = $this->registry->create('Parser');