mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-11-09 15:28:40 +00:00
Make purifyArray work with empty array (#245)
This commit is contained in:
parent
c2c91f52d0
commit
ced089434d
@ -240,6 +240,7 @@ class HTMLPurifier
|
|||||||
public function purifyArray($array_of_html, $config = null)
|
public function purifyArray($array_of_html, $config = null)
|
||||||
{
|
{
|
||||||
$context_array = array();
|
$context_array = array();
|
||||||
|
$array = array();
|
||||||
foreach($array_of_html as $key=>$value){
|
foreach($array_of_html as $key=>$value){
|
||||||
if (is_array($value)) {
|
if (is_array($value)) {
|
||||||
$array[$key] = $this->purifyArray($value, $config);
|
$array[$key] = $this->purifyArray($value, $config);
|
||||||
|
@ -32,6 +32,13 @@ class HTMLPurifierTest extends HTMLPurifier_Harness
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_purifyArray_empty() {
|
||||||
|
$purifiedEmptyArray = $this->purifier->purifyArray(array());
|
||||||
|
$this->assertTrue(
|
||||||
|
empty($purifiedEmptyArray)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public function testGetInstance()
|
public function testGetInstance()
|
||||||
{
|
{
|
||||||
$purifier = HTMLPurifier::getInstance();
|
$purifier = HTMLPurifier::getInstance();
|
||||||
|
Loading…
Reference in New Issue
Block a user