Jump to content

Is it possible to XSS with htmlentities enabled?


PugJr

Recommended Posts

 

 $postcontent = protection($postcontent); 

 

That being how the content is protected. The function is:

 

 function protection($content){

$content = htmlentities($content);

$content = mysql_real_escape_string($content);

return $content;

} 

 

 

Anything I should do to protection() to make it more secure?

You call mysql_real_escape_string() before inserting into the database.

 

You call htmlentities() before displaying database content in the browser.

 

I do not recommend calling htmlentities() before inserting to the database.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.