[TikiWiki-commits] [Git][tikiwiki/tiki][master] [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 <694512fa51e07_2a17fbb043991@gitlab-sidekiq-low-urgency-cpu-bound-v2-647dd7658c-9j4kb.mail>

Victor Emanouilov pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
4d20e130 by Victor Emanouilov at 2025-12-19T10:55:16+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/4d20e13056d156dc1751811322f534272e7d24ab

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