Lines Matching refs:key
86 static zend_bool php_mail_build_headers_check_field_name(zend_string *key) in php_mail_build_headers_check_field_name() argument
91 while (len < key->len) { in php_mail_build_headers_check_field_name()
92 if (*(key->val+len) < 33 || *(key->val+len) > 126 || *(key->val+len) == ':') { in php_mail_build_headers_check_field_name()
101 static void php_mail_build_headers_elems(smart_str *s, zend_string *key, zval *val);
103 static void php_mail_build_headers_elem(smart_str *s, zend_string *key, zval *val) in php_mail_build_headers_elem() argument
107 if (php_mail_build_headers_check_field_name(key) != SUCCESS) { in php_mail_build_headers_elem()
108 zend_value_error("Header name \"%s\" contains invalid characters", ZSTR_VAL(key)); in php_mail_build_headers_elem()
112 …end_value_error("Header \"%s\" has invalid format, or contains invalid characters", ZSTR_VAL(key)); in php_mail_build_headers_elem()
115 smart_str_append(s, key); in php_mail_build_headers_elem()
121 php_mail_build_headers_elems(s, key, val); in php_mail_build_headers_elem()
124 …zend_type_error("Header \"%s\" must be of type array|string, %s given", ZSTR_VAL(key), zend_zval_t… in php_mail_build_headers_elem()
129 static void php_mail_build_headers_elems(smart_str *s, zend_string *key, zval *val) in php_mail_build_headers_elems() argument
136 …zend_type_error("Header \"%s\" must only contain numeric keys, \"%s\" found", ZSTR_VAL(key), ZSTR_… in php_mail_build_headers_elems()
140 …zend_type_error("Header \"%s\" must only contain values of type string, %s found", ZSTR_VAL(key), … in php_mail_build_headers_elems()
143 php_mail_build_headers_elem(s, key, tmp_val); in php_mail_build_headers_elems()
151 zend_string *key; in php_mail_build_headers() local
155 ZEND_HASH_FOREACH_KEY_VAL(headers, idx, key, val) { in php_mail_build_headers()
156 if (!key) { in php_mail_build_headers()
161 switch(ZSTR_LEN(key)) { in php_mail_build_headers()
163 if (!strncasecmp("orig-date", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
164 PHP_MAIL_BUILD_HEADER_CHECK("orig-date", s, key, val); in php_mail_build_headers()
166 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
170 if (!strncasecmp("from", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
171 PHP_MAIL_BUILD_HEADER_CHECK("from", s, key, val); in php_mail_build_headers()
173 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
177 if (!strncasecmp("sender", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
178 PHP_MAIL_BUILD_HEADER_CHECK("sender", s, key, val); in php_mail_build_headers()
180 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
184 if (!strncasecmp("reply-to", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
185 PHP_MAIL_BUILD_HEADER_CHECK("reply-to", s, key, val); in php_mail_build_headers()
187 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
191 if (!strncasecmp("to", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
195 if (!strncasecmp("cc", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
196 PHP_MAIL_BUILD_HEADER_CHECK("cc", s, key, val); in php_mail_build_headers()
198 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
202 if (!strncasecmp("bcc", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
203 PHP_MAIL_BUILD_HEADER_CHECK("bcc", s, key, val); in php_mail_build_headers()
205 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
209 if (!strncasecmp("message-id", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
210 PHP_MAIL_BUILD_HEADER_CHECK("message-id", s, key, val); in php_mail_build_headers()
211 } else if (!strncasecmp("references", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
212 PHP_MAIL_BUILD_HEADER_CHECK("references", s, key, val); in php_mail_build_headers()
214 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
218 if (!strncasecmp("in-reply-to", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
219 PHP_MAIL_BUILD_HEADER_CHECK("in-reply-to", s, key, val); in php_mail_build_headers()
221 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
225 if (!strncasecmp("subject", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
229 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
232 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()