Skip to content

Commit 13f4757

Browse files
committed
ext/standard/mail.c: refactor php_mail_build_headers_check_field_name()
Fix incorrect return type Use zend_string macros
1 parent 4166fc2 commit 13f4757

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

ext/standard/mail.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,13 @@ static php_mail_header_value_error_type php_mail_build_headers_check_field_value
112112
return NO_HEADER_ERROR;
113113
}
114114

115-
116-
static bool php_mail_build_headers_check_field_name(const zend_string *key)
115+
static zend_result php_mail_build_headers_check_field_name(const zend_string *key)
117116
{
118117
size_t len = 0;
119118

120119
/* https://tools.ietf.org/html/rfc2822#section-2.2 */
121-
while (len < key->len) {
122-
if (*(key->val+len) < 33 || *(key->val+len) > 126 || *(key->val+len) == ':') {
120+
while (len < ZSTR_LEN(key)) {
121+
if (*(ZSTR_VAL(key)+len) < 33 || *(ZSTR_VAL(key)+len) > 126 || *(ZSTR_VAL(key)+len) == ':') {
123122
return FAILURE;
124123
}
125124
len++;

0 commit comments

Comments
 (0)