-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DirectLex
will cause PHP error
#393
Comments
What is the value of |
When I dump the value:
In my example, the attribute key is
|
lenhatthanh20
changed the title
Dec 25, 2023
DirectLex
will cause PHP error with declare(strict_types=1);
DirectLex
will cause PHP error
matsuo
added a commit
to matsuo/htmlpurifier
that referenced
this issue
Jul 29, 2024
…tLex is used (Fix ezyang#393)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
htmlpurifier/library/HTMLPurifier/Token/Tag.php
Line 47 in bbc513d
Hello,
When I use HTML Purifier with
Core.LexerImpl = DirectLex
, The PHP error will cause in above line when I purify the below data:<a href="https://example.com/" 10="hoge">Test</a>
Because the key of attribute is
non-string
value. So the PHP error will be occured.Ref: https://www.php.net/manual/en/function.ctype-lower.php
Please help to fix it.
I think we can fix it by using quick typecast in the
Tag.php
file:$key = (string)$key;
Or remove the attribute if the key is non-string value.
Thank you so much
The text was updated successfully, but these errors were encountered: