diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-12-17 09:01:54 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-12-17 09:02:13 +0100 |
commit | 867cb7dbf960dc0cfbf7e59d656d1337bb59c526 (patch) | |
tree | 5bbdf1eef51cd3747f55ef2c524364f9cd3bf029 /vendor/fguillot/picofeed/lib/PicoFeed/Filter/Filter.php | |
parent | a813b535eeb517e0ccd69a90d0058756014a1e01 (diff) |
update picofeed, fix #695
Diffstat (limited to 'vendor/fguillot/picofeed/lib/PicoFeed/Filter/Filter.php')
-rw-r--r-- | vendor/fguillot/picofeed/lib/PicoFeed/Filter/Filter.php | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Filter.php b/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Filter.php index 0490e2f49..82289444b 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Filter.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Filter.php @@ -2,6 +2,8 @@ namespace PicoFeed\Filter; +use PicoFeed\Parser\XmlParser; + /** * Filter class * @@ -137,34 +139,4 @@ class Filter return $data; } - - /** - * Get the first XML tag - * - * @static - * @access public - * @param string $data Feed content - * @return string - */ - public static function getFirstTag($data) - { - // Strip HTML comments (max of 5,000 characters long to prevent crashing) - $data = preg_replace('/<!--(.{0,5000}?)-->/Uis', '', $data); - - /* Strip Doctype: - * Doctype needs to be within the first 100 characters. (Ideally the first!) - * If it's not found by then, we need to stop looking to prevent PREG - * from reaching max backtrack depth and crashing. - */ - $data = preg_replace('/^.{0,100}<!DOCTYPE([^>]*)>/Uis', '', $data); - - // Strip <?xml version.... - $data = self::stripXmlTag($data); - - // Find the first tag - $open_tag = strpos($data, '<'); - $close_tag = strpos($data, '>'); - - return substr($data, $open_tag, $close_tag); - } } |