| 
	
 | 
 Posted by Jon on 05/02/06 22:50 
I went back and re-tested it, and it is in fact returning true despite my  
htaccess explicitly turing magic_quotes off. 
 
"Chung Leong" <chernyshevsky@hotmail.com> wrote in message  
news:1146525708.253074.185500@u72g2000cwu.googlegroups.com... 
> 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] 
 |