I’m using a shared host server which I can’t control.
The PHP is initialized with the --enable-magic-quotes
parameter so I must use stripslashes
to retrieve unescaped $_GET
parameters.
The problem is that I cannot detect this behavior at runtime (PHP 5.4.41):
all of these functions return “false”:
ini_get(magic_quotes_sybase)
get_magic_quotes_gpc()
get_magic_quotes_runtime()
Is there any way I can detect on runtime, without changing server configuration, whether I need to use stripslashes
or not?
EDIT I use WordPress platform, my own PHP code is quite minor.
Here you go
get_magic_quotes_gpc()
Returns 0 if magic_quotes_gpc is off, 1 otherwise. Or always returns FALSE as of PHP 5.4.0 because it no longer exists as of PHP5.4.0As magic_quotes were removed as of PHP5.4.0 you might want to do this instead :
If you can use .htaccess try