From 7dc7eb19f101203a508863d440e184fa7c6e9444 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 21 Jun 2012 17:31:27 +0200 Subject: Fixed custom header name validity check, made RFC2822-compliant Updated localization files list in package.xml --- plugins/managesieve/Changelog | 3 +++ plugins/managesieve/managesieve.php | 7 +++++-- plugins/managesieve/package.xml | 21 +++++++++++++++++++-- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog index 1e6011064..64542c6dc 100644 --- a/plugins/managesieve/Changelog +++ b/plugins/managesieve/Changelog @@ -1,6 +1,9 @@ +* version 5.1 [2012-06-21] +----------------------------------------------------------- - Fixed filter popup width (for non-english localizations) - Fixed tokenizer infinite loop on invalid script content - Larry skin support +- Fixed custom header name validity check, made RFC2822-compliant * version 5.0 [2012-01-05] ----------------------------------------------------------- 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'])) diff --git a/plugins/managesieve/package.xml b/plugins/managesieve/package.xml index 207793958..1c60a7cc9 100644 --- a/plugins/managesieve/package.xml +++ b/plugins/managesieve/package.xml @@ -17,9 +17,9 @@ alec@alec.pl yes - 2012-01-05 + 2012-06-21 - 5.0 + 5.1 5.0 @@ -38,34 +38,51 @@ + + + + + + + + + + + + + + + + + -- cgit v1.2.3