Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Richard Heyes' Blog:
More on Cleaning Input Data
Jul 08, 2005 @ 11:17:09

Richard Heyes has a new post on his weblog today with three good functions to help you clean up input data.

When you code with register_globals and magic_quotes_gpc off, it's easy to forget that some people do actually use them. Subsequently it's quite easy to inadvertently introduce vulnerabilities into your code when it's used on such a platform.

The [following] code can be dropped into your app, into a common include for example, to fix this. Simply call dispelGlobals() and dispelMagicQuotes() and stop worrying.

The three quick little functions can help make your scripts a bit more secure with every page load. The register_globals and magic_quotes_gpc settings, while useful in their own right, seem to cause more harm than good when it comes to web applications. Hopefully, these functions can help take some of the egde off...

tagged:

Link:


Trending Topics: