[TikiWiki-commits] [Git][tikiwiki/tiki][29.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 <6945130688603_2a6fe078276b@gitlab-sidekiq-low-urgency-cpu-bound-v2-647dd7658c-25mvs.mail>

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


Commits:
5d51f35f by Victor Emanouilov at 2025-12-19T10:55:28+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
=====================================
@@ -208,8 +208,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/5d51f35ffd1199e11fbbb49e7977715a595f3529

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/5d51f35ffd1199e11fbbb49e7977715a595f3529
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.