[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] ListExecute: email sending with custom from address

"luci \(@luciash\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6a88698a98120_3818cdec51676@gitlab-sidekiq-low-urgency-cpu-bound-v2-8dd7d6497-qm2vr.mail>

luci pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
813a0385 by Domeshow Emmanuel at 2026-08-21T15:00:40+00:00
[FIX] ListExecute: email sending with custom from address
---
* [FIX] ListExecute -  email sending with custom from address

See merge request tikiwiki/tiki!11028

- - - - -


2 changed files:

- lib/core/Search/Action/EmailAction.php
- lib/test/Core/Search/EmailActionTest.php


Changes:

=====================================
lib/core/Search/Action/EmailAction.php
=====================================
@@ -80,7 +80,7 @@ class Search_Action_EmailAction implements Search_Action_Action
 
             if ($from = $data->from->raw()) {
                 $fromEmail = $this->dereference($from);
-                $fromName = $this->dereferenceName($from);
+                $fromName = $this->dereferenceName($from) ?: '';
                 if (! empty($fromEmail[0])) {
                     $mail->setFrom($fromEmail[0], $fromName);
                     $mail->setSender($fromEmail[0], $fromName);


=====================================
lib/test/Core/Search/EmailActionTest.php
=====================================
@@ -157,6 +157,22 @@ class SearchActionEmailActionTest extends TikiTestCase
         ])));
     }
 
+    public function testExecuteAllowsLiteralFromEmailAddressWithoutDisplayName()
+    {
+        $this->mail->expects($this->once())
+            ->method('setFrom')
+            ->with('[email protected]', '');
+        $this->mail->expects($this->once())
+            ->method('setSender')
+            ->with('[email protected]', '');
+        $this->expectSend(['[email protected]'], true);
+
+        $this->assertTrue($this->action->execute($this->createInput([
+            'from' => '[email protected]',
+            'to' => ['[email protected]'],
+        ])));
+    }
+
     private function createInput(array $overrides = []): JitFilter
     {
         return new JitFilter(array_merge([



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

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/813a0385d631938d0c94c465bf716f5374dc6423
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
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.