FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Sanitising input
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Sanitising input [message #172099 is a reply to message #172096] Sun, 30 January 2011 19:55 Go to previous messageGo to previous message
Felix Saphir is currently offline  Felix Saphir
Messages: 8
Registered: December 2010
Karma:
Junior Member
P E Schoen <paul(at)pstech-inc(dot)com> wrote:

> "Mad Hatter" wrote in message
> news:1vh6rvby4n32n$(dot)1rlvhdwm2g874$(dot)dlg(at)40tude(dot)net...
>
>> I'm writing a simple script which will take a users input, save
>> it to a mysql database and then display it. I'm going to use
>> htmlentities() to clean things up which I hope will stop basic
>> attacks but how else should I sanitise my input?
>
> I am using www.HTMLpurifier.org and it works quite well. It
> allows some HTML and it actually fixes broken or misplaced tags.
> Here is how I sanitize my CGI input:

Just to prevent misunderstandings: As Michael and Denis already
wrote, do NOT mistake HTML "cleanup" for sanitising user input.
It might be useful to use strip_tags() to remove unwanted HTML
from input, but that's not the same thing.

Felix
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Only SPAM!!!
Next Topic: What *tasks* are hard for PHP?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 13:26:36 GMT 2024

Total time taken to generate the page: 0.04060 seconds