View Single Post
Old 08-23-2006, 11:24 AM  
k0nr4d
Confirmed User
 
k0nr4d's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,229
Can't you do like
php_flag magic_quotes_gpc on
in htaccess?

Quote:
Originally Posted by calmlikeabomb
However, you shouldn't ever assume it's gonna be enabled on every machine. I'll share two functions that I use to escape quotes in data:

PHP Code:
if(!function_exists('my_stripslashes')) { function my_stripslashes($str) {    if (!get_magic_quotes_gpc()) { return stripslashes($str); } else { return $str; }}}
if(!
function_exists('my_addslashes')) { function my_addslashes($str) { if (!get_magic_quotes_gpc()) { return addslashes($str); } else { return $str; }}} 
k0nr4d is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote