ID: 42657 Updated by: [EMAIL PROTECTED] Reported By: jcortinap at googlemail dot com -Status: Assigned +Status: Closed Bug Type: *General Issues Operating System: Win XP Pro / Win 2003 Server PHP Version: 5.2.4 Assigned To: jani New Comment:
This bug has been fixed in CVS. 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/. Thank you for the report, and for helping us make PHP better. The fix will be in PHP 5.3 and upwards. Previous Comments: ------------------------------------------------------------------------ [2007-09-18 11:39:04] jcortinap at googlemail dot com Thank you for your reply. The problem we are having with this, is that when we call ini_set('SMTP', 'our_server') it returns a boolean FALSE which, also according to the manual, means failure, and then there is an error being generated in our application. How can we then differentiate a FALSE being returned from a failure or as the current value of the setting? ------------------------------------------------------------------------ [2007-09-18 11:32:38] [EMAIL PROTECTED] Another note: sendmail_from is set to NULL by default (ie. if it's not set in php.ini, the value for it is NULL -> causes ini_get() to return false. This should be mentioned in the documentation. I'm going to fix this for 5.3 (among lot of other issues with ini handling), so once docs are updated, reassign this back to me. ------------------------------------------------------------------------ [2007-09-13 12:28:56] jcortinap at googlemail dot com Description: ------------ This problem was found trying to set the sendmail_from directive from a script. This directive is intentionally NOT set on the php.ini (it is commented out). According to the documentation, ini_get should return an empty string since the directive is not set, but it returns a boolean false. When calling ini_set to set the value, it is expected to get the old value on success or FALSE on failure, and what we experience is that the setting is correctly set, but FALSE is returned. My theory is that ini_set is working correctly returning the "old" value of the setting, but since the old value is being returned as FALSE from ini_get, this is what we get as a return from ini_set, so the problem seems to be in the ini_get function. Tested with the same results on both 4.4.7 and 5.2.4. Reproduce code: --------------- // sendmail_from not set in php.ini. This should return an empty string $value = ini_get('sendmail_from'); var_dump($value); // sendmail_from is correctly set, so an empty string should be returned $old_value = ini_set('sendmail_from', '[EMAIL PROTECTED]'); var_dump($old_value); // new value of the sendmail_from directive is correctly set $value = ini_get('sendmail_from'); var_dump($value); Expected result: ---------------- string(0) "" string(0) "" string(16) "[EMAIL PROTECTED]" Actual result: -------------- bool(false) bool(false) string(16) "[EMAIL PROTECTED]" ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42657&edit=1