You are here: Re: More magic quotes questions « PHP Programming Language « IT news, forums, messages
Re: More magic quotes questions

Posted by Chung Leong on 11/19/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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация