mirror of
https://github.com/friendica/friendica
synced 2025-04-26 02:30:11 +00:00
mistpark 2.0 infrasturcture lands
This commit is contained in:
parent
b49858b038
commit
ffb1997902
360 changed files with 25001 additions and 457 deletions
32
library/HTMLPurifier/PropertyListIterator.php
Normal file
32
library/HTMLPurifier/PropertyListIterator.php
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Property list iterator. Do not instantiate this class directly.
|
||||
*/
|
||||
class HTMLPurifier_PropertyListIterator extends FilterIterator
|
||||
{
|
||||
|
||||
protected $l;
|
||||
protected $filter;
|
||||
|
||||
/**
|
||||
* @param $data Array of data to iterate over
|
||||
* @param $filter Optional prefix to only allow values of
|
||||
*/
|
||||
public function __construct(Iterator $iterator, $filter = null) {
|
||||
parent::__construct($iterator);
|
||||
$this->l = strlen($filter);
|
||||
$this->filter = $filter;
|
||||
}
|
||||
|
||||
public function accept() {
|
||||
$key = $this->getInnerIterator()->key();
|
||||
if( strncmp($key, $this->filter, $this->l) !== 0 ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// vim: et sw=4 sts=4
|
Loading…
Add table
Add a link
Reference in a new issue