laminas / laminas-escaper

Securely and safely escape HTML, HTML attributes, JavaScript, CSS, and URLs
https://docs.laminas.dev/laminas-escaper/
BSD 3-Clause "New" or "Revised" License
191 stars 20 forks source link

HTML escaping forward slash #2

Open weierophinney opened 4 years ago

weierophinney commented 4 years ago

OWASP recommends escaping the forward slash character in addition to the other characters normally escaped with PHP's htmlspecialchars() method. Any thought to adding that to the escapeHTML() method?


Originally posted by @lindonb at https://github.com/zendframework/zend-escaper/issues/23

weierophinney commented 4 years ago

As far as I know, no modern browser currently in operation would be vulnerable to that character. Putting it another way:

All that said, there's no specific reason why there would not be a user agent which does support null end tags in one of their SGML or HTML profiles (not XML AFAIK where the null end tag must be enclosed). You might have to build that agent yourself though, or dig up a copy of something from the 90s.


Originally posted by @padraic at https://github.com/zendframework/zend-escaper/issues/23#issuecomment-296969556