Lines Matching refs:key

120 static zend_bool php_mail_build_headers_check_field_name(zend_string *key)  in php_mail_build_headers_check_field_name()  argument
125 while (len < key->len) { in php_mail_build_headers_check_field_name()
126 if (*(key->val+len) < 33 || *(key->val+len) > 126 || *(key->val+len) == ':') { in php_mail_build_headers_check_field_name()
135 static void php_mail_build_headers_elems(smart_str *s, zend_string *key, zval *val);
137 static void php_mail_build_headers_elem(smart_str *s, zend_string *key, zval *val) in php_mail_build_headers_elem() argument
141 if (php_mail_build_headers_check_field_name(key) != SUCCESS) { in php_mail_build_headers_elem()
142 … php_error_docref(NULL, E_WARNING, "Header field name (%s) contains invalid chars", ZSTR_VAL(key)); in php_mail_build_headers_elem()
146 … "Header field value (%s => %s) contains invalid chars or format", ZSTR_VAL(key), Z_STRVAL_P(val)); in php_mail_build_headers_elem()
149 smart_str_append(s, key); in php_mail_build_headers_elem()
155 php_mail_build_headers_elems(s, key, val); in php_mail_build_headers_elem()
158 …rror_docref(NULL, E_WARNING, "headers array elements must be string or array (%s)", ZSTR_VAL(key)); in php_mail_build_headers_elem()
163 static void php_mail_build_headers_elems(smart_str *s, zend_string *key, zval *val) in php_mail_build_headers_elems() argument
176 php_error_docref(NULL, E_WARNING, "Multiple header values must be string (%s)", ZSTR_VAL(key)); in php_mail_build_headers_elems()
179 php_mail_build_headers_elem(s, key, tmp_val); in php_mail_build_headers_elems()
187 zend_string *key; in php_mail_build_headers() local
193 ZEND_HASH_FOREACH_KEY_VAL(HASH_OF(headers), idx, key, val) { in php_mail_build_headers()
194 if (!key) { in php_mail_build_headers()
199 switch(ZSTR_LEN(key)) { in php_mail_build_headers()
201 if (!strncasecmp("orig-date", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
202 PHP_MAIL_BUILD_HEADER_CHECK("orig-date", s, key, val); in php_mail_build_headers()
204 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
208 if (!strncasecmp("from", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
209 PHP_MAIL_BUILD_HEADER_CHECK("from", s, key, val); in php_mail_build_headers()
211 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
215 if (!strncasecmp("sender", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
216 PHP_MAIL_BUILD_HEADER_CHECK("sender", s, key, val); in php_mail_build_headers()
218 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
222 if (!strncasecmp("reply-to", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
223 PHP_MAIL_BUILD_HEADER_CHECK("reply-to", s, key, val); in php_mail_build_headers()
225 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
229 if (!strncasecmp("to", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
233 if (!strncasecmp("cc", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
234 PHP_MAIL_BUILD_HEADER_CHECK("cc", s, key, val); in php_mail_build_headers()
236 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
240 if (!strncasecmp("bcc", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
241 PHP_MAIL_BUILD_HEADER_CHECK("bcc", s, key, val); in php_mail_build_headers()
243 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
247 if (!strncasecmp("message-id", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
248 PHP_MAIL_BUILD_HEADER_CHECK("message-id", s, key, val); in php_mail_build_headers()
249 } else if (!strncasecmp("references", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
250 PHP_MAIL_BUILD_HEADER_CHECK("references", s, key, val); in php_mail_build_headers()
252 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
256 if (!strncasecmp("in-reply-to", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
257 PHP_MAIL_BUILD_HEADER_CHECK("in-reply-to", s, key, val); in php_mail_build_headers()
259 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
263 if (!strncasecmp("subject", ZSTR_VAL(key), ZSTR_LEN(key))) { in php_mail_build_headers()
267 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()
270 PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val); in php_mail_build_headers()