Re: Use PHP to build a Twitter-like system on your site
by jonursenbach on Thursday February 26, 2009 @02:18PM
(#496261)
htmlentities() might help to protect you from SQL injection, but it won't do a damn thing against XSS attacks.
[ Parent
| on HN ]
Re: Use PHP to build a Twitter-like system on your site
by jncraton on Thursday February 26, 2009 @02:31PM
(#496279)
I'll admit that I'm no PHP expert, but I was under the impression that htmlentities prevented XSS by converting all special html characters to their equivalent html entity.
If HTML entities works properly, and it is used properly, shouldn't it prevent XSS since an attacker who inputs something like <script>alert("xss")</script> would simply see the message displayed back to them instead of the browser actually executing it?
Re: Use PHP to build a Twitter-like system on your site
by jonursenbach on Thursday February 26, 2009 @02:40PM
(#496290)
Hmm, yeah you're right. I'm not sure what I was thinking of.