Skip to content
Browse files

Mail\Header/GenericHeader.php: Adjust regex to RFC 5322

  • Loading branch information...
1 parent 569eaa2 commit 6f9fdc5edf87d892f6983d5c9d9fa7f057073ba7 @steffenweber steffenweber committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 library/Zend/Mail/Header/GenericHeader.php
View
4 library/Zend/Mail/Header/GenericHeader.php
@@ -76,9 +76,9 @@ public function setFieldName($fieldName)
$fieldName = str_replace(' ', '-', ucwords(str_replace(array('_', '-'), ' ', $fieldName)));
// Validate what we have
- if (!preg_match('/^[a-z][a-z0-9-]*$/i', $fieldName)) {
+ if (!preg_match('/^[\x21-\x39\x3B-\x7E]*$/i', $fieldName)) {
throw new Exception\InvalidArgumentException(
- 'Header name must start with a letter, and consist of only letters, numbers and dashes.'
+ 'Header name must be composed of printable US-ASCII characters, except colon.'
);
}

0 comments on commit 6f9fdc5

Please sign in to comment.
Something went wrong with that request. Please try again.