diff --git a/libraries/joomla/html/html/email.php b/libraries/joomla/html/html/email.php index d468705dbf86c..b20a2934eca01 100644 --- a/libraries/joomla/html/html/email.php +++ b/libraries/joomla/html/html/email.php @@ -34,72 +34,58 @@ abstract class JHtmlEmail */ public static function cloak($mail, $mailto = 1, $text = '', $email = 1) { + /** + * Original approach breaks site content when combined with + * AJAX calls, i.e. JomSocial + * + * Current implementation relies on jQuery, please extend for + * other JS libraries + */ // Convert text $mail = JHtmlEmail::_convertEncoding($mail); // Split email by @ symbol $mail = explode('@', $mail); $mail_parts = explode('.', $mail[1]); // Random number - $rand = rand(1, 100000); - - $replacement = "\n '; - - // XHTML compliance no Javascript text handling - $replacement .= ""; - $replacement .= JText::_('JLIB_HTML_CLOAKING'); - $replacement .= "\n "; - + $__mail = '__' + rand(1, 100000); + + + // Convert text + $text = JHtmlEmail::_convertEncoding($text); + // Split email by @ symbol + $text = explode('@', $text); + $text_parts = explode('.', $text[1]); + // Random number + $__text = '__' + rand(1, 100000); + + ob_start(); + ?> + + +