summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hoffend <dh@dotlan.net>2015-02-18 22:00:07 (GMT)
committerDaniel Hoffend <dh@dotlan.net>2015-02-18 22:00:07 (GMT)
commit77e67f34ac5560caad011a4e85e2a87ad11275dd (patch)
tree2bc1818ea176aac3071ee5938bb83d8f39ce6d32
parente712eaf3caff0e5e114410bdb2cdb9d7b2ace1eb (diff)
downloadkolab-wap-77e67f34ac5560caad011a4e85e2a87ad11275dd.tar.gz
added more characaters to check for cn / kolabTargetFolder. @ % ^
-rw-r--r--lib/api/kolab_api_service_form_value.php12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/api/kolab_api_service_form_value.php b/lib/api/kolab_api_service_form_value.php
index 6b32523..86e1a26 100644
--- a/lib/api/kolab_api_service_form_value.php
+++ b/lib/api/kolab_api_service_form_value.php
@@ -1335,8 +1335,8 @@ class kolab_api_service_form_value extends kolab_api_service
private function validate_cn_sharedfolder($value, $postdata = array(), $validation_type = null)
{
- if (preg_match('/["\']/',$value)) {
- throw new Exception("Folder name contains invalid characters: \" ']");
+ if (preg_match('/["\'@%+^]/',$value)) {
+ throw new Exception("Folder name contains invalid characters: \" ' @ % + ^");
}
return 'OK';
@@ -1344,13 +1344,9 @@ class kolab_api_service_form_value extends kolab_api_service
private function validate_kolabtargetfolder_sharedfolder($value, $postdata = array(), $validation_type = null)
{
- if (preg_match('/["\'\+]/',$value)) {
- throw new Exception("Target IMAP Folder contains invalid characters \" ' +");
- }
-
$domains = $this->_get_valid_domains();
- if (!preg_match('#^shared/[^"\'\\+]+@('.implode("|",$domains).')$#',$value)) {
- throw new Exception("Target IMAP Folder has to match the following format: 'shared/foldername@mydomain.org'"&& folderpart == cn (other));
+ if (!preg_match('#^shared/[^"\'\\+@%^]+@('.implode("|",$domains).')$#',$value)) {
+ throw new Exception("Target IMAP Folder has to match the following format: 'shared/foldername@mydomain.org' and the foldername can't contain invalid characters: \" ' @ % + ^");
}
// TODO: check for duplicate shared folder