Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'hotfix/4224'

Close #4224
  • Loading branch information...
commit ee0bd4db49dfc1925fb1a1239aa306a624111a93 2 parents b725fb4 + e6476a5
@weierophinney weierophinney authored
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);
Please sign in to comment.
Something went wrong with that request. Please try again.