| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Old Sites/moke/libraries/joomla/html/html/ |
Upload File : |
<?php
/**
* @package Joomla.Platform
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
/**
* Utility class for cloaking email adresses
*
* @package Joomla.Platform
* @subpackage HTML
* @since 11.1
*/
abstract class JHtmlEmail
{
/**
* Simple Javascript email Cloaker
*
* By default replaces an email with a mailto link with email cloacked
*/
public static function cloak($mail, $mailto=1, $text='', $email=1)
{
// 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 <script type='text/javascript'>";
$replacement .= "\n <!--";
$replacement .= "\n var prefix = 'ma' + 'il' + 'to';";
$replacement .= "\n var path = 'hr' + 'ef' + '=';";
$replacement .= "\n var addy". $rand ." = '". @$mail[0] ."' + '@';";
$replacement .= "\n addy". $rand ." = addy". $rand ." + '". implode("' + '.' + '", $mail_parts) ."';";
if ($mailto) {
// Special handling when mail text is different from mail addy
if ($text) {
if ($email) {
// Convert text
$text = JHtmlEmail::_convertEncoding($text);
// Split email by @ symbol
$text = explode('@', $text);
$text_parts = explode('.', $text[1]);
$replacement .= "\n var addy_text". $rand ." = '". @$text[0] ."' + '@' + '". implode("' + '.' + '", @$text_parts) ."';";
} else {
$replacement .= "\n var addy_text". $rand ." = '". $text ."';";
}
$replacement .= "\n document.write('<a ' + path + '\'' + prefix + ':' + addy". $rand ." + '\'>');";
$replacement .= "\n document.write(addy_text". $rand .");";
$replacement .= "\n document.write('<\/a>');";
} else {
$replacement .= "\n document.write('<a ' + path + '\'' + prefix + ':' + addy". $rand ." + '\'>');";
$replacement .= "\n document.write(addy". $rand .");";
$replacement .= "\n document.write('<\/a>');";
}
} else {
$replacement .= "\n document.write(addy". $rand .");";
}
$replacement .= "\n //-->";
$replacement .= '\n </script>';
// XHTML compliance no Javascript text handling
$replacement .= "<script type='text/javascript'>";
$replacement .= "\n <!--";
$replacement .= "\n document.write('<span style=\'display: none;\'>');";
$replacement .= "\n //-->";
$replacement .= "\n </script>";
$replacement .= JText::_('JLIB_HTML_CLOAKING');
$replacement .= "\n <script type='text/javascript'>";
$replacement .= "\n <!--";
$replacement .= "\n document.write('</');";
$replacement .= "\n document.write('span>');";
$replacement .= "\n //-->";
$replacement .= "\n </script>";
return $replacement;
}
protected static function _convertEncoding($text)
{
// Replace vowels with character encoding
$text = str_replace('a', 'a', $text);
$text = str_replace('e', 'e', $text);
$text = str_replace('i', 'i', $text);
$text = str_replace('o', 'o', $text);
$text = str_replace('u', 'u', $text);
return $text;
}
}