diff options
author | Aleksander Machniak <alec@alec.pl> | 2012-06-21 17:31:27 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2012-06-21 17:47:35 +0200 |
commit | 454021736845af0f645412b600bbc81bb177d807 (patch) | |
tree | d892a8548e256cc4b55cd0b015a6ff1634177af4 /plugins/managesieve/managesieve.php | |
parent | 1948d366ce0909fe5ea9616811c2fd3c680b8142 (diff) |
Fixed custom header name validity check, made RFC2822-compliant
Updated localization files list in package.xml
Diffstat (limited to 'plugins/managesieve/managesieve.php')
-rw-r--r-- | plugins/managesieve/managesieve.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/managesieve/managesieve.php b/plugins/managesieve/managesieve.php index c58dc8cab..7c10053a3 100644 --- a/plugins/managesieve/managesieve.php +++ b/plugins/managesieve/managesieve.php @@ -709,9 +709,12 @@ class managesieve extends rcube_plugin if (!count($headers)) $this->errors['tests'][$i]['header'] = $this->gettext('cannotbeempty'); else { - foreach ($headers as $hr) - if (!preg_match('/^[a-z0-9-]+$/i', $hr)) + foreach ($headers as $hr) { + // RFC2822: printable ASCII except colon + if (!preg_match('/^[\x21-\x39\x41-\x7E]+$/i', $hr)) { $this->errors['tests'][$i]['header'] = $this->gettext('forbiddenchars'); + } + } } if (empty($this->errors['tests'][$i]['header'])) |