Skip to content

Commit

Permalink
Avoid a deprecated error when the attribute name is numeric and Direc…
Browse files Browse the repository at this point in the history
…tLex is used (Fix ezyang#393)
  • Loading branch information
matsuo committed Jul 29, 2024
1 parent c2aadb6 commit 65c48c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/HTMLPurifier/Token/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct($name, $attr = array(), $line = null, $col = null, $
$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];
Expand Down

0 comments on commit 65c48c8

Please sign in to comment.