]> git.immae.eu Git - github/wallabag/wallabag.git/blame - inc/3rdparty/htmlpurifier/HTMLPurifier/PropertyListIterator.php
remove autoload section in composer.json
[github/wallabag/wallabag.git] / inc / 3rdparty / htmlpurifier / HTMLPurifier / PropertyListIterator.php
CommitLineData
d4949327
NL
1<?php\r
2\r
3/**\r
4 * Property list iterator. Do not instantiate this class directly.\r
5 */\r
6class HTMLPurifier_PropertyListIterator extends FilterIterator\r
7{\r
8\r
9 /**\r
10 * @type int\r
11 */\r
12 protected $l;\r
13 /**\r
14 * @type string\r
15 */\r
16 protected $filter;\r
17\r
18 /**\r
19 * @param Iterator $iterator Array of data to iterate over\r
20 * @param string $filter Optional prefix to only allow values of\r
21 */\r
22 public function __construct(Iterator $iterator, $filter = null)\r
23 {\r
24 parent::__construct($iterator);\r
25 $this->l = strlen($filter);\r
26 $this->filter = $filter;\r
27 }\r
28\r
29 /**\r
30 * @return bool\r
31 */\r
32 public function accept()\r
33 {\r
34 $key = $this->getInnerIterator()->key();\r
35 if (strncmp($key, $this->filter, $this->l) !== 0) {\r
36 return false;\r
37 }\r
38 return true;\r
39 }\r
40}\r
41\r
42// vim: et sw=4 sts=4\r