Fix incorrect PEARSax3 test assertion.
[htmlpurifier.git] / library / HTMLPurifier / PropertyListIterator.php
blob8f250443e41f0aa6c0f468cf825a2c94e743a350
1 <?php
3 /**
4 * Property list iterator. Do not instantiate this class directly.
5 */
6 class HTMLPurifier_PropertyListIterator extends FilterIterator
9 protected $l;
10 protected $filter;
12 /**
13 * @param $data Array of data to iterate over
14 * @param $filter Optional prefix to only allow values of
16 public function __construct(Iterator $iterator, $filter = null) {
17 parent::__construct($iterator);
18 $this->l = strlen($filter);
19 $this->filter = $filter;
22 public function accept() {
23 $key = $this->getInnerIterator()->key();
24 if( strncmp($key, $this->filter, $this->l) !== 0 ) {
25 return false;
27 return true;
32 // vim: et sw=4 sts=4