Category
stdlib | child of #3285 (mail transport depth)
Problem
After sendmail transport (#3285), mail() still only accepts a string for $additional_headers. Zend 8.x accepts array|string and validates via php_mail_build_headers() — rejecting embedded To/Subject, invalid field names, and CR/LF/NUL in values with ValueError / TypeError.
php-src reference
Repro (failure after #3285 transport lands)
<?php
try {
mail('a@b.c', 'subj', 'body', ['To' => 'evil@x']);
echo "NO_THROW\n";
} catch (ValueError $e) {
echo "ValueError\n";
}
| Engine |
Result |
| Zend 8.4 |
ValueError (additional headers cannot contain To) |
| VM today |
TypeError (string required) or wrong accept |
Scope
| Path |
Work |
ext/standard/VmMail.php / mail.php |
array headers → RFC2822 lines; ValueError parity |
| Tests |
test/compliance/cases/stdlib/mail_headers_array.phpt |
Done when (php-src-strict)
Related
Category
stdlib| child of #3285 (mail transport depth)Problem
After sendmail transport (#3285),
mail()still only accepts a string for$additional_headers. Zend 8.x acceptsarray|stringand validates viaphp_mail_build_headers()— rejecting embeddedTo/Subject, invalid field names, and CR/LF/NUL in values withValueError/TypeError.php-src reference
ext/standard/mail.c—PHP_FUNCTION(mail),php_mail_build_headers,php_mail_build_headers_check_field_*Repro (failure after #3285 transport lands)
ValueError(additional headers cannot contain To)TypeError(string required) or wrong acceptScope
ext/standard/VmMail.php/mail.phptest/compliance/cases/stdlib/mail_headers_array.phptDone when (php-src-strict)
mail(..., ['From' => 'x@y'])builds header line and reaches transportTo/Subjectkeys →ValueErrormatching Zend message shapeValueError.phptgreen on VMRelated