- Fixed bug #33427 (ext/odbc: check if unixODBC header file exists). (Jani)
- Fixed bug #33257 (array_splice() inconsistent when passed function instead
of variable). (Dmitry)
+- Fixed bug #15854 (boolean ini options may be incorrectly displayed as Off
+ when they are On). (Tony)
21 Jun 2005, PHP 5.1 Beta 2
- Improved PHP extension loading mechanism with support for module dependencies
ZEND_INI_DISP(zend_ini_boolean_displayer_cb)
{
- int value;
+ int value, tmp_value_len;
+ char *tmp_value;
if (type==ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
- value = (ini_entry->orig_value ? atoi(ini_entry->orig_value) : 0);
+ tmp_value = (ini_entry->orig_value ? ini_entry->orig_value : NULL );
+ tmp_value_len = ini_entry->orig_value_length;
} else if (ini_entry->value) {
- value = atoi(ini_entry->value);
+ tmp_value = ini_entry->value;
+ tmp_value_len = ini_entry->value_length;
} else {
- value = 0;
+ tmp_value = NULL;
+ tmp_value_len = 0;
}
+
+ if (tmp_value_len == 4 && strcasecmp(tmp_value, "true") == 0) {
+ value = 1;
+ }
+ else if (tmp_value_len == 3 && strcasecmp(tmp_value, "yes") == 0) {
+ value = 1;
+ }
+ else if (tmp_value_len == 2 && strcasecmp(tmp_value, "on") == 0) {
+ value = 1;
+ }
+ else {
+ value = atoi(tmp_value);
+ }
+
if (value) {
ZEND_PUTS("On");
} else {
p = (zend_bool *) (base+(size_t) mh_arg1);
- if (new_value_length==2 && strcasecmp("on", new_value)==0) {
+ if (new_value_length==2 && strcasecmp("on", new_value)==0) {
*p = (zend_bool) 1;
- } else {
+ }
+ else if (new_value_length==3 && strcasecmp("yes", new_value)==0) {
+ *p = (zend_bool) 1;
+ }
+ else if (new_value_length==4 && strcasecmp("true", new_value)==0) {
+ *p = (zend_bool) 1;
+ }
+ else {
*p = (zend_bool) atoi(new_value);
}
return SUCCESS;