com php-src: Merge branch 'PHP-5.6': ext/standard/mail.c
| From: | Stanislav Malyshev | Date: | Mon, 29 Jun 2015 07:31:56 +0000 |
| Subject: | com php-src: Merge branch 'PHP-5.6': ext/standard/mail.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-87594@lists.php.net to get a copy of this message | ||
Commit: 265b73e6ff627c1d0ee14009fc702fce7419344d
Author: Stanislav Malyshev <stas@php.net> Mon, 29 Jun 2015 00:31:56 -0700
Parents: a5d38e0deabe0e5b2edcb0255fc921f6be489cbd d7daf814b799393f705533c6a2db4cbab93ab12a
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=265b73e6ff627c1d0ee14009fc702fce7419344d
Log:
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
Bugs:
https://bugs.php.net/69874
Changed paths:
MM ext/standard/mail.c
Diff:
diff --cc ext/standard/mail.c
index 77ad1fe,17c09db..22ba52d
--- 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)) {