--- class.tslib_content.php 2005-03-25 18:56:30.000000000 +0100 +++ class.tslib_content.php 2005-03-28 12:10:16.010866524 +0200 @@ -4356,11 +4356,22 @@ $parts[0] = substr($textpieces[$i],0,$len); $parts[1] = substr($textpieces[$i],$len); $linktxt = ereg_replace('\?.*','',$parts[0]); - if (!$GLOBALS['TSFE']->config['config']['jumpurl_enable'] || $GLOBALS['TSFE']->config['config']['jumpurl_mailto_disable']) { - if ($GLOBALS['TSFE']->spamProtectEmailAddresses) { - $mailToUrl = "javascript:linkTo_UnCryptMailto('".$GLOBALS['TSFE']->encryptEmail('mailto:'.$parts[0])."');"; - $atLabel = trim($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses_atSubst']); - $linktxt = str_replace('@',$atLabel ? $atLabel : '(at)', $linktxt); + if (!$GLOBALS['TSFE']->config['config']['jumpurl_enable'] || $GLOBALS['TSFE']->config['config']['jumpurl_mailto_disable']) { + if ($GLOBALS['TSFE']->spamProtectEmailAddresses) { + if ($GLOBALS['TSFE']->spamProtectEmailAddresses == 'ascii') { + $mailToUrl = $GLOBALS['TSFE']->encryptEmail('mailto:'.$parts[0]); + } else { + $mailToUrl = "javascript:linkTo_UnCryptMailto('".$GLOBALS['TSFE']->encryptEmail('mailto:'.$parts[0])."');"; + } + if ($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses_atSubst']) { + $atLabel = trim($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses_atSubst']); + $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); + } } else { $mailToUrl = 'mailto:'.$parts[0]; } @@ -4864,10 +4875,21 @@ if ($linktxt=='') $linktxt = $link_param; if (!$GLOBALS['TSFE']->config['config']['jumpurl_enable'] || $GLOBALS['TSFE']->config['config']['jumpurl_mailto_disable']) { $this->lastTypoLinkUrl = 'mailto:'.$link_param; - if ($GLOBALS['TSFE']->spamProtectEmailAddresses) { - $this->lastTypoLinkUrl = "javascript:linkTo_UnCryptMailto('".$GLOBALS['TSFE']->encryptEmail($this->lastTypoLinkUrl)."');"; - $atLabel = trim($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses_atSubst']); - $linktxt=str_replace('@',$atLabel?$atLabel:'(at)',$linktxt); + if ($GLOBALS['TSFE']->spamProtectEmailAddresses) { + if ($GLOBALS['TSFE']->spamProtectEmailAddresses == 'ascii') { + $this->lastTypoLinkUrl = $GLOBALS['TSFE']->encryptEmail($this->lastTypoLinkUrl); + } else { + $this->lastTypoLinkUrl = "javascript:linkTo_UnCryptMailto('".$GLOBALS['TSFE']->encryptEmail($this->lastTypoLinkUrl)."');"; + } + if ($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses_atSubst']) { + $atLabel = trim($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses_atSubst']); + $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); + } } } else { $this->lastTypoLinkUrl = $GLOBALS['TSFE']->absRefPrefix.$GLOBALS['TSFE']->config['mainScript'].$initP.'&jumpurl='.rawurlencode('mailto:'.$link_param).$GLOBALS['TSFE']->getMethodUrlIdToken; @@ -5043,7 +5065,11 @@ $onClick="vHWin=window.open('".$GLOBALS['TSFE']->baseUrlWrap($finalTagParts['url'])."','FEopenLink','".$JSwindowParams."');vHWin.focus();return false;"; $res = ''; } else { - $res = ''; + if ($GLOBALS['TSFE']->spamProtectEmailAddresses == 'ascii') { + $res = ''; + } else { + $res = ''; + } } // Call user function: --- class.tslib_fe.php 2005-03-23 14:57:22.000000000 +0100 +++ class.tslib_fe.php 2005-03-28 12:10:48.440389239 +0200 @@ -3027,11 +3027,19 @@ */ function encryptEmail($string,$back=0) { $out = ''; - for ($a=0; $aspamProtectEmailAddresses)*($back?-1:1); - $out.= chr($charValue); + + if ($this->spamProtectEmailAddresses == 'ascii') { + for ($a=0; $aspamProtectEmailAddresses)*($back?-1:1); + $out.= chr($charValue); + } } + return $out; } @@ -3568,4 +3576,4 @@ if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/class.tslib_fe.php']) { include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/class.tslib_fe.php']); } -?> \ No newline at end of file +?> --- class.tslib_pagegen.php 2005-02-04 01:53:12.000000000 +0100 +++ class.tslib_pagegen.php 2005-03-28 12:11:11.825833921 +0200 @@ -133,9 +133,12 @@ // Internal and External target defaults $GLOBALS['TSFE']->intTarget = ''.$GLOBALS['TSFE']->config['config']['intTarget']; $GLOBALS['TSFE']->extTarget = ''.$GLOBALS['TSFE']->config['config']['extTarget']; - $GLOBALS['TSFE']->spamProtectEmailAddresses = t3lib_div::intInRange($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses'],-5,5,0); - if ($GLOBALS['TSFE']->spamProtectEmailAddresses) { - $GLOBALS['TSFE']->additionalJavaScript['UnCryptMailto()']=' + if ($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses'] == 'ascii') { + $GLOBALS['TSFE']->spamProtectEmailAddresses = 'ascii'; + } else { + $GLOBALS['TSFE']->spamProtectEmailAddresses = t3lib_div::intInRange($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses'],-5,5,0); + if ($GLOBALS['TSFE']->spamProtectEmailAddresses) { + $GLOBALS['TSFE']->additionalJavaScript['UnCryptMailto()']=' // JS function for uncrypting spam-protected emails: function UnCryptMailto(s) { // var n=0; @@ -152,6 +155,7 @@ location.href=UnCryptMailto(s); } '; + } }