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 4123b43 commit 6bf2214Copy full SHA for 6bf2214
ext/standard/mail.c
@@ -101,14 +101,13 @@ static php_mail_header_value_error_type php_mail_build_headers_check_field_value
101
102
static bool php_mail_build_headers_check_field_name(const zend_string *key)
103
{
104
- size_t len = 0;
+ const char *end = ZSTR_VAL(key) + ZSTR_LEN(key);
105
106
/* https://tools.ietf.org/html/rfc2822#section-2.2 */
107
- while (len < ZSTR_LEN(key)) {
108
- 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 == ':') {
109
return false;
110
}
111
- len++;
112
113
return true;
114
0 commit comments