Project

General

Profile

Feature #14270 » 0000286-encryptEmailAddresses.diff

Administrator Admin, 2005-03-27 21:11

View differences:

typo3/sysext/cms/tslib/class.tslib_content.php 2005-03-27 20:32:53.000000000 +0200
$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']) {
$mailToUrl = 'mailto:'.$parts[0];
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);
} else {
$mailToUrl = 'mailto:'.$parts[0];
$encryptedEmail = $GLOBALS['TSFE']->encryptEmail('mailto:'.$parts[0]);
if($encryptedEmail) { // If the encryptEmail returns false, do not encrypted the address. See tslib_fe->encryptEmail() for better explanation.
$mailToUrl = "javascript:linkTo_UnCryptMailto('".$encryptedEmail."');";
$atLabel = trim($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses_atSubst']);
$linktxt = str_replace('@',$atLabel ? $atLabel : '(at)', $linktxt);
}
}
$res = '<a href="'.htmlspecialchars($mailToUrl).'"'.$aTagParams.'>';
} else {
......
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);
$encryptedEmail = $GLOBALS['TSFE']->encryptEmail($this->lastTypoLinkUrl);
if($encryptedEmail) { // If the encryptEmail returns false, do not encrypted the address. See tslib_fe->encryptEmail() for better explanation.
$this->lastTypoLinkUrl = "javascript:linkTo_UnCryptMailto('".$encryptedEmail."');";
$atLabel = trim($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses_atSubst']);
$linktxt = str_replace('@',$atLabel?$atLabel:'(at)',$linktxt);
}
}
} else {
$this->lastTypoLinkUrl = $GLOBALS['TSFE']->absRefPrefix.$GLOBALS['TSFE']->config['mainScript'].$initP.'&jumpurl='.rawurlencode('mailto:'.$link_param).$GLOBALS['TSFE']->getMethodUrlIdToken;
typo3/sysext/cms/tslib/class.tslib_fe.php 2005-03-27 20:24:54.000000000 +0200
$charValue+= intval($this->spamProtectEmailAddresses)*($back?-1:1);
$out.= chr($charValue);
}
if(ereg('\|', $out)) { return false; } // Make sure that no "|" is in the encrypted email address. This is not very beautiful but needed because it would break table elements (the character would split a table element).
return $out;
}
(1-1/2)