Lines Matching refs:val
67 static php_mail_header_value_error_type php_mail_build_headers_check_field_value(zval *val) in php_mail_build_headers_check_field_value() argument
70 zend_string *value = Z_STR_P(val); in php_mail_build_headers_check_field_value()
75 if (*(value->val+len) == '\r') { in php_mail_build_headers_check_field_value()
76 if (*(value->val+len+1) != '\n') { in php_mail_build_headers_check_field_value()
81 && (*(value->val+len+2) == ' ' || *(value->val+len+2) == '\t')) { in php_mail_build_headers_check_field_value()
95 if (*(value->val+len) == '\n') { in php_mail_build_headers_check_field_value()
97 && (*(value->val+len+1) == ' ' || *(value->val+len+1) == '\t')) { in php_mail_build_headers_check_field_value()
103 if (*(value->val+len) == '\0') { in php_mail_build_headers_check_field_value()
118 if (*(key->val+len) < 33 || *(key->val+len) > 126 || *(key->val+len) == ':') { in php_mail_build_headers_check_field_name()
127 static void php_mail_build_headers_elems(smart_str *s, zend_string *key, zval *val);
129 static void php_mail_build_headers_elem(smart_str *s, zend_string *key, zval *val) in php_mail_build_headers_elem() argument
131 switch(Z_TYPE_P(val)) { in php_mail_build_headers_elem()
138 php_mail_header_value_error_type error_type = php_mail_build_headers_check_field_value(val); in php_mail_build_headers_elem()
161 smart_str_appends(s, Z_STRVAL_P(val)); in php_mail_build_headers_elem()
165 php_mail_build_headers_elems(s, key, val); in php_mail_build_headers_elem()
168 …("Header \"%s\" must be of type array|string, %s given", ZSTR_VAL(key), zend_zval_value_name(val)); in php_mail_build_headers_elem()
173 static void php_mail_build_headers_elems(smart_str *s, zend_string *key, zval *val) in php_mail_build_headers_elems() argument
178 ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(val), tmp_key, tmp_val) { in php_mail_build_headers_elems()
192 #define PHP_MAIL_BUILD_HEADER_CHECK(target, s, key, val) \ argument
194 if (Z_TYPE_P(val) == IS_STRING) { \
195 php_mail_build_headers_elem(&s, key, val); \
196 } else if (Z_TYPE_P(val) == IS_ARRAY) { \
201 php_mail_build_headers_elems(&s, key, val); \
203 …Header \"%s\" must be of type array|string, %s given", ZSTR_VAL(key), zend_zval_value_name(val)); \
211 zval *val; in php_mail_build_headers() local
214 ZEND_HASH_FOREACH_KEY_VAL(headers, idx, key, val) { in php_mail_build_headers()
219 ZVAL_DEREF(val); in php_mail_build_headers()
222 PHP_MAIL_BUILD_HEADER_CHECK("orig-date", s, key, val); in php_mail_build_headers()
224 PHP_MAIL_BUILD_HEADER_CHECK("from", s, key, val); in php_mail_build_headers()
226 PHP_MAIL_BUILD_HEADER_CHECK("sender", s, key, val); in php_mail_build_headers()
228 PHP_MAIL_BUILD_HEADER_CHECK("reply-to", s, key, val); in php_mail_build_headers()
232 PHP_MAIL_BUILD_HEADER_CHECK("cc", s, key, val); in php_mail_build_headers()
234 PHP_MAIL_BUILD_HEADER_CHECK("bcc", s, key, val); in php_mail_build_headers()
236 PHP_MAIL_BUILD_HEADER_CHECK("message-id", s, key, val); in php_mail_build_headers()
238 PHP_MAIL_BUILD_HEADER_CHECK("references", s, key, val); in php_mail_build_headers()
240 PHP_MAIL_BUILD_HEADER_CHECK("in-reply-to", s, key, val); in php_mail_build_headers()
244 if (Z_TYPE_P(val) == IS_STRING) { in php_mail_build_headers()
245 php_mail_build_headers_elem(&s, key, val); in php_mail_build_headers()
246 } else if (Z_TYPE_P(val) == IS_ARRAY) { in php_mail_build_headers()
247 php_mail_build_headers_elems(&s, key, val); in php_mail_build_headers()
249 …("Header \"%s\" must be of type array|string, %s given", ZSTR_VAL(key), zend_zval_value_name(val)); in php_mail_build_headers()
451 #define MAIL_RET(val) \ in php_mail() argument
455 return val; \ in php_mail()
478 len = spprintf(&tmp, 0, "[%s] %s%s", date_str->val, logline, PHP_EOL); in php_mail()