|
Posted by Chung Leong on 01/20/08 11:46
Jon wrote:
> Problem is the 'get_magic_quotes_gpc()' function doesn't seem able to pickup
> the htaccess directive that turns them off, so it is always reported on.
> This basically traps me into not being able to check if they're on or off,
> or simply counting on them for my own application and leaving them on (I
> have no access to the .ini to turn them off at all).
Are you sure your observation is correct? get_magic_quotes_gpc()
returns the variable that controls whether slashes are added or not. If
it returns true, then magic_quotes_gpc is on. If it returns false, then
it's off--unless you alter the state through ini_set() afterward, of
course.
>From the source code:
PHP_FUNCTION(get_magic_quotes_gpc)
{
RETURN_LONG(PG(magic_quotes_gpc));
}
if (PG(magic_quotes_gpc)) {
Z_STRVAL(new_entry) = php_addslashes(strval, Z_STRLEN(new_entry),
&Z_STRLEN(new_entry), 0 TSRMLS_CC);
} else {
Z_STRVAL(new_entry) = estrndup(strval, Z_STRLEN(new_entry));
}
Navigation:
[Reply to this message]
|