[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [FIX] email dereferencing in list execute email action: deal wiht commas and...

"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6945140ce4647_2a12d90c8769b4@gitlab-sidekiq-low-urgency-cpu-bound-v2-647dd7658c-4rx99.mail>

Victor Emanouilov pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki


Commits:
f7555441 by Victor Emanouilov at 2025-12-19T10:59:51+02:00
[FIX] email dereferencing in list execute email action: deal wiht commas and semi-colons more diligently, avoid spaces

- - - - -


1 changed file:

- lib/core/Search/Action/EmailAction.php


Changes:

=====================================
lib/core/Search/Action/EmailAction.php
=====================================
@@ -274,8 +274,16 @@ class Search_Action_EmailAction implements Search_Action_Action
         if (empty($email_or_username)) {
             return [];
         }
-        if (strpbrk($email_or_username, ',; ') !== false) {
-            $list = preg_split('/\s*[,;\s]\s*/', $email_or_username);
+        if (str_contains($email_or_username, ';')) {
+            $list = preg_split('/\s*;\s*/', $email_or_username);
+            $res = [];
+            foreach ($list as $email_or_username) {
+                $res = array_merge($res, $this->dereference($email_or_username));
+            }
+            return array_filter($res);
+        }
+        if (str_contains($email_or_username, ',') && ! str_contains($email_or_username, '<')) {
+            $list = preg_split('/\s*,\s*/', $email_or_username);
             $res = [];
             foreach ($list as $email_or_username) {
                 $res = array_merge($res, $this->dereference($email_or_username));



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/f75554412abb2b10ddbc164e2a1ddb2516e56b97

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/f75554412abb2b10ddbc164e2a1ddb2516e56b97
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.