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

View File

@ -460,10 +460,20 @@ class Filter
public static function stripXmlTag($data) public static function stripXmlTag($data)
{ {
if (strpos($data, '<?xml') !== false) { if (strpos($data, '<?xml ') !== false) {
$data = substr($data, strrpos($data, '?>') + 2); $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; return $data;
} }