Fixed bug 3985: Wrong substitution for spamProtectEmailAddresses_atSubst/spamProtectE...
authorOliver Hader <oliver.hader@typo3.org>
Tue, 6 Feb 2007 15:37:16 +0000 (15:37 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Tue, 6 Feb 2007 15:37:16 +0000 (15:37 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2010 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/class.tslib_content.php

index 2b7c8c9..83398e0 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-02-06  Oliver Hader  <oh@inpublica.de>
+
+       * Fixed bug 3985: Wrong substitution for spamProtectEmailAddresses_atSubst/spamProtectEmailAddresses_lastDotSubst
+
 2007-02-06  Martin Kutschker  <martin.t.kutschker@blackbox.net>
 
        * Fixed bug #4742: link to user on User Admin page is following to wrong URL
index b966447..9badd2c 100755 (executable)
@@ -5475,6 +5475,7 @@ class tslib_cObj {
         */
        function getMailTo($mailAddress,$linktxt,$initP='?') {
                if(!strcmp($linktxt,''))        { $linktxt = $mailAddress; }
+               $linktxtIsMailAddress = ($linktxt == $mailAddress ? true : false);
 
                $mailToUrl = 'mailto:'.$mailAddress;
 
@@ -5488,12 +5489,16 @@ class tslib_cObj {
                                if ($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses_atSubst']) {
                                        $atLabel = trim($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses_atSubst']);
                                }
-                               $linktxt = str_replace('@',$atLabel?$atLabel:'(at)',$linktxt);
+                               if ($linktxtIsMailAddress) {
+                                       $linktxt = str_replace('@',$atLabel?$atLabel:'(at)',$linktxt);
+                               }
 
                                if ($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses_lastDotSubst']) {
                                        $lastDotLabel = trim($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses_lastDotSubst']);
                                        $lastDotLabel = $lastDotLabel ? $lastDotLabel : '(dot)';
-                                       $linktxt = preg_replace('/\.([^\.]+)$/', $lastDotLabel.'$1', $linktxt);
+                                       if ($linktxtIsMailAddress) {
+                                               $linktxt = preg_replace('/\.([^\.]+)$/', $lastDotLabel.'$1', $linktxt);
+                                       }
                                }
                        }
                } else {