aboutsummaryrefslogtreecommitdiff
path: root/lib/SimplePie/SimplePie.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-07 19:27:52 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-07 19:27:52 +0100
commit316778ef47394b27047abd9c9a739c34d2fd3829 (patch)
treecafce2e9dd4ad41aa0570a49e33d8ad0fa50a46a /lib/SimplePie/SimplePie.php
parent6464666075170b006501c4f12d6a2f470300af46 (diff)
Un morceau de tolérance XML oublié
Diffstat (limited to 'lib/SimplePie/SimplePie.php')
-rw-r--r--lib/SimplePie/SimplePie.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/SimplePie/SimplePie.php b/lib/SimplePie/SimplePie.php
index 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 SimplePie
foreach ($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');