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

Home » Imported messages » comp.lang.php » Sanitizing user input
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Sanitizing user input [message #169753 is a reply to message #169745] Fri, 24 September 2010 17:12 Go to previous message
Michael Fesser is currently offline  Michael Fesser
Messages: 215
Registered: September 2010
Karma:
Senior Member
.oO(MikeB)

> I was considering building this "mega-sanitizing routing" and simply run
> al luser input through it and apply every manner of sanitizing, but it
> seems I'll have to be more selective, since I don't know that I can
> reverse all the processes if need be.

Correct. There's no one-fits-all routine. Inside your application you
should always work with the real, raw data (which is why stripslashes()
might be required to remove automatically added slashes by Magic Quotes,
in PHP 6 it will become obsolete). And then always apply the appropriate
escaping functions, depending on where your data goes. Every context,
every output target requires another kind of escaping. In a DB query you
have to call another escaping function than for an HTML output, even if
it's the same data.

Micha
[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
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: how to write a wsdl for php webservice?
Next Topic: ANNOUNCE - NHI1 / PLMK / libmsgque - Work-Package-II
Goto Forum:
  

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

Current Time: Wed Nov 27 11:12:35 GMT 2024

Total time taken to generate the page: 0.04150 seconds