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

From: Date: Sun, 18 May 2003 21:32:37 +0000
Subject: #23663 [Csd->Opn]: ini_get bug when directives come from .htaccess
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969353634@lists.php.net to get a copy of this message
ID: 23663 Updated by: derick@php.net Reported By: jdell_nv at yahoo dot com -Status: Closed +Status: Open Bug Type: Documentation problem Operating System: Linux 2.4.20smp (RH9) PHP Version: 4.3.2RC2 New Comment: Let's leave it open for the Doc people to 'fix' this. Previous Comments: ------------------------------------------------------------------------ [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 (#969353634) next »