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:31:27 +0200 |
commit | 7dc7eb19f101203a508863d440e184fa7c6e9444 (patch) | |
tree | 5460f8f908c22ab6e06b259b07d9549895f0975c /plugins/managesieve/managesieve.php | |
parent | 6bb44a644ad9a256f2cd154cfbdb7bdfede3fa6a (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 486b3fb1d..70ef5f597 100644 --- a/plugins/managesieve/managesieve.php +++ b/plugins/managesieve/managesieve.php @@ -707,9 +707,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'])) |