Skip to content
Browse files

Merge branch 'hotfix/4224' into develop

Forward port #4224
  • Loading branch information...
2 parents a76b2f5 + e6476a5 commit 48b60eb82b3fa10ff650d627746f342b9fec1a4c @weierophinney weierophinney committed Apr 15, 2013
Showing with 3 additions and 3 deletions.
  1. +2 −2 library/Zend/Mail/Header/GenericHeader.php
  2. +1 −1 library/Zend/Mail/Headers.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.'
);
}
View
2 library/Zend/Mail/Headers.php
@@ -70,7 +70,7 @@ public static function fromString($string, $EOL = self::EOL)
// iterate the header lines, some might be continuations
foreach (explode($EOL, $string) as $line) {
// check if a header name is present
- if (preg_match('/^(?P<name>[^()><@,;:\"\\/\[\]?=}{ \t]+):.*$/', $line, $matches)) {
+ if (preg_match('/^(?P<name>[\x21-\x39\x3B-\x7E]+):.*$/', $line, $matches)) {
if ($currentLine) {
// a header name was present, then store the current complete line
$headers->addHeaderLine($currentLine);

0 comments on commit 48b60eb

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