diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 2635156411f..8dfafb19b63 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -146,6 +146,7 @@ if (GETPOST('addfilter', 'alpha')) { $emailcollectorfilter->rulevalue = GETPOST('rulevalue', 'alpha'); $emailcollectorfilter->fk_emailcollector = $object->id; $emailcollectorfilter->status = 1; + $result = $emailcollectorfilter->create($user); if ($result > 0) { diff --git a/htdocs/emailcollector/class/emailcollectorfilter.class.php b/htdocs/emailcollector/class/emailcollectorfilter.class.php index c19610f14ad..cff80aa4153 100644 --- a/htdocs/emailcollector/class/emailcollectorfilter.class.php +++ b/htdocs/emailcollector/class/emailcollectorfilter.class.php @@ -158,6 +158,7 @@ class EmailCollectorFilter extends CommonObject public function create(User $user, $notrigger = false) { global $langs; + if (empty($this->type)) { $langs->load("errors"); $this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")); @@ -169,6 +170,12 @@ class EmailCollectorFilter extends CommonObject return -2; } + if (in_array($this->type, array('to')) && strpos($this->rulevalue, '+') != false) { + $langs->load("errors"); + $this->errors[] = $langs->trans("ErrorCharPlusNotSupportedByImapForSearch"); + return -3; + } + return $this->createCommon($user, $notrigger); } diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index afcc12e9362..056e2088611 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -294,6 +294,7 @@ ErrorQuantityIsLimitedTo=Quantity is limited to %s ErrorFailedToLoadThirdParty=Failed to find/load thirdparty from id=%s, email=%s, name=%s ErrorThisPaymentModeIsNotSepa=This payment mode is not a bank account ErrorStripeCustomerNotFoundCreateFirst=Stripe customer is not set for this thirdparty (or set to a value deleted on Stripe side). Create (or re-attach) it first. +ErrorCharPlusNotSupportedByImapForSearch=IMAP search is not able to search into sender or recipient for a string containing the character + # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.