#23663 [Opn->Csd]: ini_get bug when directives come from .htaccess

From: Date: Mon, 19 May 2003 02:33:14 +0000
Subject: #23663 [Opn->Csd]: ini_get bug when directives come from .htaccess
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969353638@lists.php.net to get a copy of this message
ID: 23663 Updated by: alindeman@php.net Reported By: jdell_nv at yahoo dot com -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: Linux 2.4.20smp (RH9) PHP Version: 4.3.2RC2 New Comment: This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. I shortened the note a bit, as IMO a deep explanation isn't needed. Previous Comments: ------------------------------------------------------------------------ [2003-05-18 16:32:36] derick@php.net Let's leave it open for the Doc people to 'fix' this. ------------------------------------------------------------------------ [2003-05-18 15:37:00] jdell_nv at yahoo dot com Thanks Sniper! added clarifying comments at: http://www.php.net/manual/en/configuration.changes.php ------------------------------------------------------------------------ [2003-05-18 11:47:05] sniper@php.net You should be using php_flag instead. With php_value, you should use 1 or 0 for such options. Not bug, but could be clarified a bit at http://www.php.net/manual/en/configuration.changes.php ------------------------------------------------------------------------ [2003-05-16 14:06:08] jdell_nv at yahoo dot com Hi, I'm running apache 1.3.27 and PHP 4.3.2 RC2 (both compiled from source). I found a problem when you setup apache to 'AllowOverride All' and then set php directives from the .htacess file. For example, the magic_quotes_gpc directive: With php.ini configs, the ini_get value: magic_quotes_gpc = 1 or blank With .htacess configs, the ini_get value: magic_quotes_gpc = On or Off So (as per php.net docs) ini_get is converting the "On/Off" values in php.ini to "1" or blank, but if the value comes from .htaccess, it is not converted (they stay as "On/Off" values). This causes problems when developers assume ini_get returns boolean and can be used in an expression such as "if (ini_get('magic_quotes_gpc'))..." because ini_get can return "Off" which will evaluate to TRUE. I think this is a bug in ini_get or is an undocumented behavior. Please let me know if any other information would be helpful in figuring this out! Thanks, John ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23663&edit=1

« previous php.doc (#969353638) next »