Bug #31829
mailto links wrong if spamProtectEmailAddresses = ascii
| Status: | Resolved | Start date: | 2011-11-15 | |
|---|---|---|---|---|
| Priority: | Should have | Due date: | ||
| Assignee: | Ines Willenbrock | % Done: | 0% |
|
| Category: | Forum | |||
| Target version: | 1.9.3 | |||
| Votes: | 0 |
Description
If there is an email address in a post message, and config.spamProtectEmailAddresses is set to "ascii", the corresponding mailto link is generated wrong.
Also the "config.spamProtectEmailAddresses_lastDotSubst" parameter will be ignored completely.
Solution:
includes/class.tx_mmforum_postparser.php line 198
function getMailTo($mailAddress, $linktxt, $initP='?') {
if (!strcmp($linktxt, '')) {
$linktxt = $mailAddress;
}
$mailToUrl = 'mailto:' . $mailAddress;
if ($GLOBALS['TSFE']->spamProtectEmailAddresses) {
$email_substr = $parent->config['email_subst'] = $GLOBALS['TSFE']->tmpl->setup['config.']['spamProtectEmailAddresses_atSubst'];
$lastDotLabel = $GLOBALS['TSFE']->tmpl->setup['config.']['spamProtectEmailAddresses_lastDotSubst'];
if($GLOBALS['TSFE']->tmpl->setup['config.']['spamProtectEmailAddresses'] != 'ascii') {
$mailToUrl = "javascript:linkTo_UnCryptMailto('" . $GLOBALS['TSFE']->encryptEmail($mailToUrl) . "');";
} else {
$mailToUrl = $GLOBALS['TSFE']->encryptEmail($mailToUrl);
}
$mailToUrl = str_replace('<', '<', $mailToUrl);
$linktxt = str_replace('@', $email_substr, $linktxt);
$lastDotLabel = $lastDotLabel ? $lastDotLabel : '[dot]';
$linktxt = preg_replace('/\.([^\.]+)$/', $lastDotLabel . '$1', $linktxt);
}
return array($mailToUrl, $linktxt);
}
History
Updated by Ines Willenbrock 10 months ago
- Status changed from New to Needs Feedback
Hi, could you please post the incorrect mailto-Link?
Thanks, Ines
Updated by Ines Willenbrock 10 months ago
- Assignee set to Ines Willenbrock
- Target version set to 1.9.3
Nevermind, your patch seems to work.
regards - Ines
Updated by Simon Schaufelberger 10 months ago
commited with r65411
Updated by Simon Schaufelberger 10 months ago
- Status changed from Needs Feedback to Resolved