Cloaking email addresses on the web is mandatory these days thanks to the spam vermin out there. Joomla includes a nice content plugin that takes care of this task for you automatically. Unfortunately it also breaks form input values if they contain a pattern that appears to be an email address. The problem is caused by the "catch-all" generic search and replace the plugin does at around line 157 of /plugins/content/emailcloak.php. Here is a quick 'n dirty fix:
Find this (around line 157)
while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) {
$mail = $regs[1][0];
$replacement = JHTML::_('email.cloak', $mail, $mode);
// Replace the found address with the js cloaked email
$text = substr_replace($text, $replacement, $regs[1][1], strlen($mail));
}
.. and replace with this
$offset = 0;
while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE, $offset)) {
if ($regs[2][0] != '"') {
$mail = $regs[1][0];
$replacement = JHTML::_('email.cloak', $mail, $mode);
// Replace the found address with the js cloaked email
$text = substr_replace($text, $replacement, $regs[1][1], strlen($mail));
$offset += strlen($replacement);
} else {
$offset = $regs[2][1];
}
}
This should keep you safe if you are using double quotes to enclose your tag attributes, i.e., <input type="text" name="email" value="
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
">