TheoGB;10952513 wrote:Actually there's no harm in having them turned on beyond how annoying they are.
Actually, there is. magic_quotes_gpc destroys the integrity of incoming data... and for what? It doesn't properly sanitize data for use in DB queries, so you can't even argue that, really.
Besides, if there was "no harm" in having them turne don, why would the PHP manual use the word DEPRECATED in big capital letters like that? Plus, look at the third bullet in the link (to the Security section of the PHP manual) you posted above: "Why not to use Magic Quotes."
TheoGB;10952513 wrote:It's hardly in the same league as leaving yourself wide open for a SQL-injection, which is what your response seems to imply.
I never implied that you shouldn't sanitize user-supplied data when using it in a SQL query (search for "user-supplied data" posted by "bradgrafelman" - I guarantee you'll find hundreds of threads where I mentioned this over the years).
Besides, as I mentioned above, magic_quotes_gpc doesn't even properly sanitize data for SQL queries.
TheoGB;10952513 wrote:I'm pretty sure I tried turning them off in a site where I couldn't set the PHP.INI. I did it by having that as the first line in the global include file on all PHP files.
Sorry, but I have to disagree. As the manual says ([man]ini.list[/man]), magic_quotes_gpc can only be set in a .htaccess, httpd.conf, or php.ini file - not within a script itself. This should make sense, since magic_quotes_gpc's role is to alter the GPC data before your script is executed.
Still don't believe me? Click on the link on the fourth bullet ("Disabling Magic Quotes") of the page you linked to above and you'll find this:
PHP Manual wrote:The magic_quotes_gpc directive may only be disabled at the system level, and not at runtime. In otherwords, use of ini_set() is not an option.