Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/4224'
Browse files Browse the repository at this point in the history
Close #4224
  • Loading branch information
weierophinney committed Apr 15, 2013
2 parents b725fb4 + e6476a5 commit ee0bd4d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions library/Zend/Mail/Header/GenericHeader.php
Expand Up @@ -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.'
);
}

Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Mail/Headers.php
Expand Up @@ -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);
Expand Down

0 comments on commit ee0bd4d

Please sign in to comment.