magic_quotes
| From: | Johannes Lindenbaum | Date: | Thu, 30 Nov 2006 05:55:46 +0000 |
| Subject: | magic_quotes | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-245326@lists.php.net to get a copy of this message | ||
Evening,
I am new to this list, so please if this email is "offensive" to anyone I didn't know any better. Not here to start a war or similar.
I have a couple questions about magic_quotes and it's deletion in PHP 6.
I've been lazily following php.internals and read about register_globals and magic_quotes (finally) being deleted from PHP.
I don't have any scripts that run with register_globals - not worried about PHP 6 for that case.
But... magic_quotes.
If my understanding is correct magic quotes will give ', " and \ (for ASCII characters, e.g. \n) a preceding backslash to escape it. I also see that magic_quotes_gpc() is On by default. So all data in $_POST and $_GET etc. has escaping backslashes.
If in a .htaccess I should set
php_flag magic_quotes_gpc Off
That would lead to $_POST data like Jingle's Bells to be passed as Jingle's Bells, not Jingle\'s Bells. Usually most of my $_POST data gets written into a MySQL table to which I perform addslashes(). And on retrieval stripslashes().
If I keep on doing that - and just start coding with magic_quotes_gpc Off - my scripts shouldn't alter behaviour upon PHP 6 arrival, should they?
Kind Regards,
Johannes Lindenbaum