Why is turning on magic_quotes_gpc in PHP considered a bad practice?
I don't think I can explain it any better than the makers of PHP itself (with followup comments on that page): Why not to use Magic Quotes
get_magic_quotes_gpc()
to check for this, and code accordingly.addslashes()
) at runtime is more efficient. Although php.ini-development enables these directives by default, php.ini-production disables it. This recommendation is mainly due to performance reasons.stripslashes()
.Note - This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With