mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-18 02:39:56 +09:00
merge from 1.6 ( html purifier lib )
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10579 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
8943ff97f3
commit
7ea7157ce7
813 changed files with 65203 additions and 0 deletions
|
|
@ -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