If html tags are filtered to prevent xss injection, the rich text editor is useless. If html tags are kept, xss injection is not prevented. Normally, how does one solve this problem ??? Only filter specific tags ??? If html tags are filtered to prevent xss injection, the rich text editor is useless. If html tags are kept, xss injection is not prevented.
Normally, how does one solve this problem ??? Only filter specific tags ???
Reply content:
If html tags are filtered to prevent xss injection, the rich text editor is useless. If html tags are kept, xss injection is not prevented.
Normally, how does one solve this problem ??? Only filter specific tags ???
HTML Purifier is an HTML filter written in PHP. it can be used with the WYSIWYG editor to filter out XSS malicious code.
purify($html);
I think the white list is good. keep the tags you want to use and filter all others.
If your rich text editor supports any function, no filtering is required. Do you need to know if you have received a p tag and whether it was added manually or in your editor?
Do you want to use your own new syntax?
Just filter out the js script.
Escape as entity character when warehouse receiving
Restore when warehouse is released.
And filter out
Script
Javascript: xxx;
This