diff options
Diffstat (limited to 'vendor/fguillot/picofeed/lib/PicoFeed/Filter/Tag.php')
-rw-r--r-- | vendor/fguillot/picofeed/lib/PicoFeed/Filter/Tag.php | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Tag.php b/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Tag.php index b14ed9481..6347054bb 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Tag.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Tag.php @@ -3,7 +3,9 @@ namespace PicoFeed\Filter; use DOMXpath; + use PicoFeed\Parser\XmlParser; +use PicoFeed\Config\Config; /** * Tag Filter class @@ -14,6 +16,14 @@ use PicoFeed\Parser\XmlParser; class Tag { /** + * Config object + * + * @access private + * @var \PicoFeed\Config\Config + */ + private $config; + + /** * Tags blacklist (Xpath expressions) * * @access private @@ -71,6 +81,11 @@ class Tag 'q', ); + public function __construct(Config $config) + { + $this->config = $config; + } + /** * Check if the tag is allowed and is not a pixel tracker * @@ -130,7 +145,10 @@ class Tag */ public function isAllowedTag($tag) { - return in_array($tag, $this->tag_whitelist); + return in_array($tag, array_merge( + $this->tag_whitelist, + array_keys($this->config->getFilterWhitelistedTags(array())) + )); } /** |