Skip to content

Commit 402f084

Browse files
committed
ext/standard/mail.c: use php_mail_build_headers_elem() directly
The branching logic is already defined in the function
1 parent 67a89f6 commit 402f084

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

ext/standard/mail.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,7 @@ PHPAPI zend_string *php_mail_build_headers(const HashTable *headers)
245245
} else if (zend_string_equals_literal_ci(key, "subject")) {
246246
zend_value_error("The additional headers cannot contain the \"Subject\" header");
247247
} else {
248-
if (Z_TYPE_P(val) == IS_STRING) {
249-
php_mail_build_headers_elem(&s, key, val);
250-
} else if (Z_TYPE_P(val) == IS_ARRAY) {
251-
php_mail_build_headers_elems(&s, key, val);
252-
} else {
253-
zend_type_error("Header \"%s\" must be of type array|string, %s given", ZSTR_VAL(key), zend_zval_value_name(val));
254-
}
248+
php_mail_build_headers_elem(&s, key, val);
255249
}
256250

257251
if (EG(exception)) {

0 commit comments

Comments
 (0)