foreach ($this->tagArray as $i => $tag) {
if ($tag['closing']) {
// closing tag
- if (\in_array($tag['name'], $openTagStack) && $this->isAllowed($openTagStack, $tag['name'], true)) {
+ if (\in_array($tag['name'], $openTagStack)) {
// close unclosed tags
$tmpOpenTags = [];
while (($previousTag = \end($openTagStack)) != $tag['name']) {
}
} else {
// opening tag
- if ($this->isAllowed($openTagStack, $tag['name']) && $this->isValidTag($tag)) {
+ if ($this->isValidTag($tag)) {
$openTagStack[] = $tag['name'];
$openTagDataStack[] = $tag;
$nextIndex = \count($newTagArray);
}
$newTextArray[$nextIndex] .= $this->textArray[$i];
} else {
- // tag not allowed
$this->textArray[$i] .= $tag['source'];
$last = \count($newTagArray);
if (!isset($newTextArray[$last])) {