Bug fix for RSS2 detection

This commit is contained in:
Frédéric Guillot 2013-12-15 22:38:06 -05:00
parent 282c1cb5ad
commit fab7b8b04b
1 changed files with 12 additions and 2 deletions

View File

@ -460,10 +460,20 @@ class Filter
public static function stripXmlTag($data)
{
if (strpos($data, '<?xml') !== false) {
$data = substr($data, strrpos($data, '?>') + 2);
if (strpos($data, '<?xml ') !== false) {
$data = ltrim(substr($data, strpos($data, '?>') + 2));
}
do {
$pos = strpos($data, '<?xml-stylesheet ');
if ($pos !== false) {
$data = ltrim(substr($data, strpos($data, '?>') + 2));
}
} while ($pos !== false && $pos < 200);
return $data;
}