Skip to content

Commit

Permalink
Allow setting of global attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
adnedelcu committed Oct 19, 2020
1 parent da76c87 commit 3396d71
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Purifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ private function addCustomAttributes(array $attributes, HTMLPurifier_HTMLDefinit
$attrName = $required ? $attribute[1] . '*' : $attribute[1];
$validValues = $attribute[2];

if ($onElement === '*') {
$definition->info_global_attr[$attrName] = $validValues;

continue;
}

$definition->addAttribute($onElement, $attrName, $validValues);
}

Expand Down

0 comments on commit 3396d71

Please sign in to comment.