We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 63bd25d commit 00543a4Copy full SHA for 00543a4
ext/standard/mail.c
@@ -109,14 +109,13 @@ static php_mail_header_value_error_type php_mail_build_headers_check_field_value
109
110
static bool php_mail_build_headers_check_field_name(const zend_string *key)
111
{
112
- size_t len = 0;
+ const char *end = ZSTR_VAL(key) + ZSTR_LEN(key);
113
114
/* https://tools.ietf.org/html/rfc2822#section-2.2 */
115
- while (len < ZSTR_LEN(key)) {
116
- if (*(ZSTR_VAL(key)+len) < 33 || *(ZSTR_VAL(key)+len) > 126 || *(ZSTR_VAL(key)+len) == ':') {
+ for (const char *ptr = ZSTR_VAL(key); ptr < end; ptr++) {
+ if (*ptr < 33 || *ptr > 126 || *ptr == ':') {
117
return false;
118
}
119
- len++;
120
121
return true;
122
0 commit comments