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

Dynamically Typed:
Magic Quotes Headaches
Mar 03, 2005 @ 13:10:21

Thomas Rutter writes over on Dynamically Typed today about a few of the Magic Quotes Headaches that he's had in the past and maybe a few ways to help you avoid them in the future.

I am frequently amazed and/or frustrated when I encounter online applications which have problems with Magic Quotes and string escaping. Even commercial PHP applications I use on a daily basis have such problems. The most common symptom is that slashes (/) end up appearing throughout content.

[...] I believe that the introduction of Magic Quotes was a mistake made by the developers of PHP - a mistake that developers are still paying for. While many PHP installations now have turned off all Magic Quotes functionality, some PHP installations still enable them for backwards-compatibility, so the problems persist.

I think most developers will agree with Thomas on this one - the whole idea behind magic quotes was well-intentioned, but not overly well thought out. It seems to cause more harm than good and can pretty easy confuse people new to the language...

tagged:

Link:


Trending Topics: