Skip to content
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

JavaScript keywords will be removed in pre/code tag #102

Open
paxter opened this issue Mar 19, 2022 · 1 comment
Open

JavaScript keywords will be removed in pre/code tag #102

paxter opened this issue Mar 19, 2022 · 1 comment
Assignees

Comments

@paxter
Copy link

paxter commented Mar 19, 2022

What is this feature about (expected vs actual behaviour)?

JavaScript elements will be removed in pre/code environment. In my opinion, content in pre/code tags should be left untouched (apart from character escaping).

How can I reproduce it?

$antiXss = new AntiXSS();

$text = "<pre>
.innerHTML
.appendChild
.onclick
</pre>";

echo $antiXss->xss_clean($text);

Result:

.

Does it take minutes, hours or days to fix?

I don't know.

Any additional information?

I'm not sure if it's a bug or intended behaviour. Maybe I should not use anti-xss on pre/code tags? This would make the usage much more complicated, because it's not possible anymore to insert any html into the xss_clean() function.

@paxter
Copy link
Author

paxter commented Apr 27, 2022

Any thoughts @voku?

@voku voku self-assigned this Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants