Skip to content

Commit

Permalink
Merge pull request #168 from mauri870/class-attr-def
Browse files Browse the repository at this point in the history
Automatically instantiate attributes using php class names
  • Loading branch information
mewebstudio authored Jul 20, 2022
2 parents a7fbdc9 + c6c5dd3 commit 164b420
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Purifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ private function addCustomAttributes(array $attributes, HTMLPurifier_HTMLDefinit
}

continue;
}
}

if (class_exists($validValues)) {
$validValues = new $validValues();
}

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

0 comments on commit 164b420

Please sign in to comment.