From c6c5dd3fdaab97c66f1bce74442d804cfc39182c Mon Sep 17 00:00:00 2001 From: Mauri de Souza Meneguzzo Date: Thu, 5 May 2022 15:13:02 -0300 Subject: [PATCH] automatically instantiate attributes using php class names --- src/Purifier.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Purifier.php b/src/Purifier.php index 9c06f02..1e34778 100644 --- a/src/Purifier.php +++ b/src/Purifier.php @@ -143,7 +143,11 @@ private function addCustomAttributes(array $attributes, HTMLPurifier_HTMLDefinit } continue; - } + } + + if (class_exists($validValues)) { + $validValues = new $validValues(); + } $definition->addAttribute($onElement, $attrName, $validValues); }