From: Stanislav Malyshev Date: Mon, 29 Jun 2015 07:31:56 +0000 (-0700) Subject: Merge branch 'PHP-5.6' X-Git-Tag: php-7.1.0alpha3~25^2~130^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=265b73e6ff627c1d0ee14009fc702fce7419344d;p=php Merge branch 'PHP-5.6' * PHP-5.6: Move strlen() check to php_mail_detect_multiple_crlf() Fixed Bug #69874 : Can't set empty additional_headers for mail() Conflicts: ext/standard/mail.c --- 265b73e6ff627c1d0ee14009fc702fce7419344d diff --cc ext/standard/mail.c index 77ad1fe0e8,17c09dbcaa..22ba52d425 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@@ -317,17 -315,18 +317,17 @@@ PHPAPI int php_mail(char *to, char *sub } if (PG(mail_x_header)) { - const char *tmp = zend_get_executed_filename(TSRMLS_C); - char *f; - size_t f_len; + const char *tmp = zend_get_executed_filename(); + zend_string *f; - php_basename(tmp, strlen(tmp), NULL, 0,&f, &f_len TSRMLS_CC); + f = php_basename(tmp, strlen(tmp), NULL, 0); - if (headers != NULL) { + if (headers != NULL && *headers) { - spprintf(&hdr, 0, "X-PHP-Originating-Script: %ld:%s\n%s", php_getuid(TSRMLS_C), f, headers); + spprintf(&hdr, 0, "X-PHP-Originating-Script: " ZEND_LONG_FMT ":%s\n%s", php_getuid(), f->val, headers); } else { - spprintf(&hdr, 0, "X-PHP-Originating-Script: %ld:%s", php_getuid(TSRMLS_C), f); + spprintf(&hdr, 0, "X-PHP-Originating-Script: " ZEND_LONG_FMT ":%s", php_getuid(), f->val); } - efree(f); + zend_string_release(f); } if (hdr && php_mail_detect_multiple_crlf(hdr)) {