com php-src: Merge branch 'pull-request/1350' into PHP-5.4: NEWS ext/standard/mail.c ext/standard/tests/mail/bug69874 _2.phpt

From: Date: Mon, 29 Jun 2015 03:18:56 +0000
Subject: com php-src: Merge branch 'pull-request/1350' into PHP-5.4: NEWS ext/standard/mail.c ext/standard/tests/mail/bug69874 _2.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-87595@lists.php.net to get a copy of this message
Commit: cd9c39d77ce22e5e377f9f23474c20374d76a10a Author: Stanislav Malyshev <stas@php.net> Sun, 28 Jun 2015 18:53:19 -0700 Parents: 921544cad96de235c451b5174d0669e02c76258b d263ecd8640697d6cde4b71ec722e8a2e5022dcf Branches: PHP-5.4 PHP-5.5 PHP-5.6 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cd9c39d77ce22e5e377f9f23474c20374d76a10a Log: Merge branch 'pull-request/1350' into PHP-5.4 * pull-request/1350: Move strlen() check to php_mail_detect_multiple_crlf() Fixed Bug #69874 : Can't set empty additional_headers for mail() Bugs: https://bugs.php.net/69874 Changed paths: MM NEWS MM ext/standard/mail.c AA ext/standard/tests/mail/bug69874_2.phpt Diff: diff --cc NEWS index 12fb9e2,7f1bf5d..6e006a4 --- a/NEWS +++ b/NEWS @@@ -2,9 -2,6 +2,11 @@@ PH ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2015 PHP 5.4.43 +- Core: + . Fixed bug #69768 (escapeshell*() doesn't cater to !). (cmb) ++ . Fixed bug #69874 (Can't set empty additional_headers for mail()), regression ++ from fix to bug #68776. (Yasuo) + 11 Jun 2015 PHP 5.4.42 - Core: diff --cc ext/standard/mail.c index 448013a,aa29a22..75bd423 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@@ -312,7 -312,7 +312,7 @@@ PHPAPI int php_mail(char *to, char *sub php_basename(tmp, strlen(tmp), NULL, 0,&f, &f_len TSRMLS_CC); -- if (headers != NULL) { ++ if (headers != NULL && *headers) { spprintf(&hdr, 0, "X-PHP-Originating-Script: %ld:%s\n%s", php_getuid(TSRMLS_C), f, headers); } else { spprintf(&hdr, 0, "X-PHP-Originating-Script: %ld:%s", php_getuid(TSRMLS_C), f); @@@ -420,7 -420,7 +420,7 @@@ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not execute mail delivery program '%s'", sendmail_path); #if PHP_SIGCHILD if (sig_handler) { -- signal(SIGCHLD, sig_handler); ++ signal(SIGCHLD, sig_handler); } #endif MAIL_RET(0); diff --cc ext/standard/tests/mail/bug69874_2.phpt index 0000000,0000000..53d991a new file mode 100644 --- /dev/null +++ b/ext/standard/tests/mail/bug69874_2.phpt @@@ -1,0 -1,0 +1,43 @@@ ++--TEST-- ++Bug #69874: Null addtional_headers does not send mail ++--INI-- ++sendmail_path=tee mailBasic.out >/dev/null ++mail.add_x_header = On ++--SKIPIF-- ++<?php ++if(substr(PHP_OS, 0, 3) == "WIN") ++ die("skip Won't run on Windows"); ++?> ++--FILE-- ++<?php ++/* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]]) ++ * Description: Send an email message ++ * Source code: ext/standard/mail.c ++ * Alias to functions: ++ */ ++ ++echo "*** Testing mail() : send email without additional headers ***\n"; ++ ++// Initialise all required variables ++$to = 'user@company.com'; ++$subject = 'Test Subject'; ++$message = 'A Message'; ++ ++$outFile = "mailBasic.out"; ++@unlink($outFile); ++ ++var_dump( mail($to, $subject, $message, '') ); ++echo file_get_contents($outFile); ++unlink($outFile); ++ ++?> ++===DONE=== ++--EXPECTF-- ++*** Testing mail() : send email without additional headers *** ++bool(true) ++To: user@company.com ++Subject: Test Subject ++X-PHP-Originating-Script: %d:bug69874_2.php ++ ++A Message ++===DONE===

« previous php.cvs (#87595) next »