Fixed bug #5602: spamProtectEmailAddresses_atSubst is not recognized correctly
authorOliver Hader <oliver.hader@typo3.org>
Fri, 30 Nov 2007 12:08:01 +0000 (12:08 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Fri, 30 Nov 2007 12:08:01 +0000 (12:08 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-1@2785 709f56b5-9817-0410-a4d7-c38de5d9e867

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

index 751fa1e..989367f 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-11-30  Oliver Hader  <oh@inpublica.de>
+
+       * Fixed bug #5602: spamProtectEmailAddresses_atSubst is not recognized correctly
+
 2007-11-24  Oliver Hader  <oh@inpublica.de>
 
        * Fixed bug #6817: Files with extension xml are ignored as resource of a template
index b3ba2d3..726d05f 100755 (executable)
@@ -5482,7 +5482,6 @@ class tslib_cObj {
         */
        function getMailTo($mailAddress,$linktxt,$initP='?') {
                if(!strcmp($linktxt,''))        { $linktxt = $mailAddress; }
-               $linktxtIsMailAddress = ($linktxt == $mailAddress ? true : false);
 
                $mailToUrl = 'mailto:'.$mailAddress;
 
@@ -5496,17 +5495,14 @@ class tslib_cObj {
                                if ($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses_atSubst']) {
                                        $atLabel = trim($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses_atSubst']);
                                }
-                               if ($linktxtIsMailAddress) {
-                                       $linktxt = str_replace('@',$atLabel?$atLabel:'(at)',$linktxt);
-                               }
+                               $spamProtectedMailAddress = str_replace('@', ($atLabel ? $atLabel : '(at)'), $mailAddress);
 
                                if ($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses_lastDotSubst']) {
                                        $lastDotLabel = trim($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses_lastDotSubst']);
                                        $lastDotLabel = $lastDotLabel ? $lastDotLabel : '(dot)';
-                                       if ($linktxtIsMailAddress) {
-                                               $linktxt = preg_replace('/\.([^\.]+)$/', $lastDotLabel.'$1', $linktxt);
-                                       }
+                                       $spamProtectedMailAddress = preg_replace('/\.([^\.]+)$/', $lastDotLabel.'$1', $spamProtectedMailAddress);
                                }
+                               $linktxt = str_replace($mailAddress, $spamProtectedMailAddress, $linktxt);
                        }
                } else {
                        $mailToUrl = $GLOBALS['TSFE']->absRefPrefix.$GLOBALS['TSFE']->config['mainScript'].$initP.'&jumpurl='.rawurlencode($mailToUrl).$GLOBALS['TSFE']->getMethodUrlIdToken;