1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-31 19:30:21 +02:00

fix: Avoid a deprecated error when the attribute name is numeric and DirectLex is used (#412)

This commit is contained in:
Atsushi Matsuo
2024-07-31 11:06:23 +09:00
committed by GitHub
parent 70754a2533
commit f0fbf51098
2 changed files with 12 additions and 1 deletions

View File

@@ -44,7 +44,7 @@ abstract class HTMLPurifier_Token_Tag extends HTMLPurifier_Token
$this->name = ctype_lower($name) ? $name : strtolower($name);
foreach ($attr as $key => $value) {
// normalization only necessary when key is not lowercase
if (!ctype_lower($key)) {
if (!ctype_lower((string)$key)) {
$new_key = strtolower($key);
if (!isset($attr[$new_key])) {
$attr[$new_key] = $attr[$key];