Lines Matching refs:key
122 static zend_bool php_mail_build_headers_check_field_name(zend_string *key) in php_mail_build_headers_check_field_name() argument
127 while (len < key->len) { in php_mail_build_headers_check_field_name()
128 if (*(key->val+len) < 33 || *(key->val+len) > 126 || *(key->val+len) == ':') { in php_mail_build_headers_check_field_name()
137 static void php_mail_build_headers_elems(smart_str *s, zend_string *key, zval *val);
139 static void php_mail_build_headers_elem(smart_str *s, zend_string *key, zval *val) in php_mail_build_headers_elem() argument
143 if (php_mail_build_headers_check_field_name(key) != SUCCESS) { in php_mail_build_headers_elem()
144 … php_error_docref(NULL, E_WARNING, "Header field name (%s) contains invalid chars", ZSTR_VAL(key)); in php_mail_build_headers_elem()
148 … "Header field value (%s => %s) contains invalid chars or format", ZSTR_VAL(key), Z_STRVAL_P(val)); in php_mail_build_headers_elem()
151 smart_str_append(s, key); in php_mail_build_headers_elem()
157 php_mail_build_headers_elems(s, key, val); in php_mail_build_headers_elem()
160 …rror_docref(NULL, E_WARNING, "headers array elements must be string or array (%s)", ZSTR_VAL(key)); in php_mail_build_headers_elem()
165 static void php_mail_build_headers_elems(smart_str *s, zend_string *key, zval *val) in php_mail_build_headers_elems() argument
178 php_error_docref(NULL, E_WARNING, "Multiple header values must be string (%s)", ZSTR_VAL(key)); in php_mail_build_headers_elems()
181 php_mail_build_headers_elem(s, key, tmp_val); in php_mail_build_headers_elems()
189 zend_string *key; in php_mail_build_headers() local
195 ZEND_HASH_FOREACH_KEY_VAL(HASH_OF(headers), idx, key, val) { in php_mail_build_headers()
196 if (!key) { in php_mail_build_headers()
201 switch(ZSTR_LEN(key)) { in php_mail_build_headers()
203 if (!strncasecmp("orig-date", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
204 PHP_MAIL_BUILD_HEADER_CHECK("orig-date", s, key, val); in php_mail_build_headers()
206 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
210 if (!strncasecmp("from", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
211 PHP_MAIL_BUILD_HEADER_CHECK("from", s, key, val); in php_mail_build_headers()
213 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
217 if (!strncasecmp("sender", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
218 PHP_MAIL_BUILD_HEADER_CHECK("sender", s, key, val); in php_mail_build_headers()
220 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
224 if (!strncasecmp("reply-to", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
225 PHP_MAIL_BUILD_HEADER_CHECK("reply-to", s, key, val); in php_mail_build_headers()
227 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
231 if (!strncasecmp("to", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
235 if (!strncasecmp("cc", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
236 PHP_MAIL_BUILD_HEADER_CHECK("cc", s, key, val); in php_mail_build_headers()
238 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
242 if (!strncasecmp("bcc", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
243 PHP_MAIL_BUILD_HEADER_CHECK("bcc", s, key, val); in php_mail_build_headers()
245 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
249 if (!strncasecmp("message-id", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
250 PHP_MAIL_BUILD_HEADER_CHECK("message-id", s, key, val); in php_mail_build_headers()
251 } else if (!strncasecmp("references", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
252 PHP_MAIL_BUILD_HEADER_CHECK("references", s, key, val); in php_mail_build_headers()
254 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
258 if (!strncasecmp("in-reply-to", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
259 PHP_MAIL_BUILD_HEADER_CHECK("in-reply-to", s, key, val); in php_mail_build_headers()
261 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
265 if (!strncasecmp("subject", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
269 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
272 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()