ID: 43348 Updated by: [EMAIL PROTECTED] Reported By: RQuadling at GMail dot com Status: Critical Bug Type: Mail related Operating System: Windows XP SP2 PHP Version: 5.3CVS-2007-11-20 (snap) -Assigned To: johannes +Assigned To: jani New Comment:
This is a regression caused by http://bugs.php.net/bug.php?id=42657 Check in was http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_ini.c?r1=1.39.2.2.2.18.2.6&r2=1.39.2.2.2.18.2.7 It affects any place that relied on INI_STR to return NULL for the original value. Previous Comments: ------------------------------------------------------------------------ [2008-07-03 12:53:48] [EMAIL PROTECTED] This needs to be fixed before 5.3 goes out the door. ------------------------------------------------------------------------ [2008-04-22 15:46:42] RQuadling at GMail dot com Nuno, if (!sendmail_path || !*sendmail_path) works for me on 5.3 CVS. Not tested HEAD as I've not got ICU yet. Richard. ------------------------------------------------------------------------ [2008-04-20 00:49:21] [EMAIL PROTECTED] Nuno I posted about the underlying change that broke this to internals last week. It's potentially broken in more places that relied on INI_STR to turn NULL as it now returns "". ------------------------------------------------------------------------ [2008-04-19 23:59:46] [EMAIL PROTECTED] a better fix is: if (!sendmail_path || !*sendmail_path) let me know if you want me to commit this. ------------------------------------------------------------------------ [2008-04-17 14:45:55] RQuadling at GMail dot com Hi. I have finally managed to get php to compile for windows (yippee for me). So I can now try and get mail() working again. The issue is that in ext/standard/mail.c (/* $Id: mail.c,v 1.87.2.1.2.7.2.3 2007/12/31 07:17:15 sebastian Exp $ */), line 197, the test of ... if (!sendmail_path) always evaluates to false when there is no sendmail_path which would be the case on windows. The next line differentiates between processing for windows/netware and everything else. If the test is if(0 == strlen(sendmail_path)) then that would work. The INI_STR call in Line 194 always returns a string if the directive is known (doesn't need to be set, just has to exist as a directive). So, I've attached a patch which I have compiled and tested on Windows. This is in relation to bug http://bugs.php.net/bug.php?id=43348 Index: mail.c =================================================================== RCS file: /repository/php-src/ext/standard/mail.c,v retrieving revision 1.87.2.1.2.7.2.3 diff -u -u -r1.87.2.1.2.7.2.3 mail.c --- mail.c 31 Dec 2007 07:17:15 -0000 1.87.2.1.2.7.2.3 +++ mail.c 17 Apr 2008 14:40:33 -0000 @@ -194,7 +194,7 @@ char *sendmail_path = INI_STR("sendmail_path"); char *sendmail_cmd = NULL; - if (!sendmail_path) { + if (0 == strlen(sendmail_path)) { #if (defined PHP_WIN32 || defined NETWARE) /* handle old style win smtp sending */ if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, headers, subject, to, message, NULL, NULL, NULL TSRMLS_CC) == FAILURE) { ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/43348 -- Edit this bug report at http://bugs.php.net/?id=43348&edit=1