mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-02 20:27:40 +02:00
Skip counting currentNesting if null
This is an error starting in PHP 7.2
This commit is contained in:
committed by
Edward Z. Yang
parent
bb7ad66526
commit
6d6d88512a
@@ -157,6 +157,7 @@ abstract class HTMLPurifier_Injector
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// check for exclusion
|
// check for exclusion
|
||||||
|
if (!empty($this->currentNesting)) {
|
||||||
for ($i = count($this->currentNesting) - 2; $i >= 0; $i--) {
|
for ($i = count($this->currentNesting) - 2; $i >= 0; $i--) {
|
||||||
$node = $this->currentNesting[$i];
|
$node = $this->currentNesting[$i];
|
||||||
$def = $this->htmlDefinition->info[$node->name];
|
$def = $this->htmlDefinition->info[$node->name];
|
||||||
@@ -164,6 +165,7 @@ abstract class HTMLPurifier_Injector
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user