Felamimail: improve link target replacement
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 8 May 2017 07:47:48 +0000 (09:47 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 10 Jul 2017 07:29:22 +0000 (09:29 +0200)
Change-Id: I8fed2c486e1f98f32e6fa14d3ae1d439233a2875
Reviewed-on: http://gerrit.tine20.com/customers/4627
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Felamimail/Controller/Message.php

index 7b262da..e6a7fef 100644 (file)
@@ -674,6 +674,9 @@ class Felamimail_Controller_Message extends Tinebase_Controller_Record_Abstract
                     $result = $this->_getAndDecodeMessageBody($_message, $_message->text_partid , Zend_Mime::TYPE_TEXT, $_account);
                     return Felamimail_Message::convertContentType(Zend_Mime::TYPE_TEXT, Zend_Mime::TYPE_HTML, $result);
                 }
+            } else {
+                // only needed without html purifier (@see Felamimail_HTMLPurifier_AttrTransform_AValidator)
+                $body = Felamimail_Message::replaceTargets($body);
             }
             
             if (! ($_account !== NULL && $_account->display_format === Felamimail_Model_Account::DISPLAY_CONTENT_TYPE && $bodyPart->type == Zend_Mime::TYPE_TEXT)) {
@@ -686,8 +689,7 @@ class Felamimail_Controller_Message extends Tinebase_Controller_Record_Abstract
                 if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__
                     . ' Do not convert ' . $bodyPart->type . ' part to ' . $_contentType);
             }
-            $body = Felamimail_Message::replaceTargets($body);
-            
+
             if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__
                 . ' Adding part ' . $partId . ' to message body.');