[TYPO3-core] RFC: Bug 3985: Wrong spamProtectEmailAddresses_lastDotSubst

Ingmar Schlecht ingmar at typo3.org
Tue Feb 6 15:24:47 CET 2007


Sounds reasonable, +1 by looking at the patch.

Due to personal taste, I would change the line
   $linktxtIsMailAddress = $linktxt == $mailAddress ? true : false;
to either
   $linktxtIsMailAddress = ($linktxt == $mailAddress ? true : false);
or
   $linktxtIsMailAddress = ($linktxt == $mailAddress);

cheers
Ingmar

Ps.: Stucki just said he'll package RC1 tonight, so until then trunk is
open.


Oliver Hader schrieb:
> This is a SVN patch request.
> 
> Problem:
> spamProtectEmailAddresses_atSubst and
> spamProtectEmailAddresses_lastDotSubst substitutes tokens, that are not
> part of the initial e-mail address. A TypoScript example:
> page = PAGE
> page {
>   typeNum = 0
>   config {
>     spamProtectEmailAddresses = 2
>     spamProtectEmailAddresses_lastDotSubst = [dot]
>   }
>   10 = TEXT
>   10.value = typo3.org e-mail
>   10.typolink.parameter = someone at typo3.org
> }
> Result: "typo3[dot]org e-mail", substituted in text-value
> 
> Solution:
> Check if the link text processed is the initial e-mail address. If so,
> do the substitutions. Otherwise don't.
> 
> Bugtracker references:
> http://bugs.typo3.org/view.php?id=3985
> 
> Branch: Trunk
> 
> 
> olly
> 
> 
> ------------------------------------------------------------------------
> 
> Index: typo3/sysext/cms/tslib/class.tslib_content.php
> ===================================================================
> --- typo3/sysext/cms/tslib/class.tslib_content.php	(Revision 2005)
> +++ typo3/sysext/cms/tslib/class.tslib_content.php	(Arbeitskopie)
> @@ -5475,6 +5475,7 @@
>  	 */
>  	function getMailTo($mailAddress,$linktxt,$initP='?') {
>  		if(!strcmp($linktxt,''))	{ $linktxt = $mailAddress; }
> +		$linktxtIsMailAddress = $linktxt == $mailAddress ? true : false;
>  
>  		$mailToUrl = 'mailto:'.$mailAddress;
>  
> @@ -5488,12 +5489,16 @@
>  				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 {


-- 
Want to know about latest core development? Subscribe to the core list!
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-team-core


More information about the TYPO3-team-core mailing list