%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 49.231.201.246 / Your IP : 216.73.216.149 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/11585/cwd/html/old/libraries/cms/html/ |
Upload File : |
<?php /** * @package Joomla.Libraries * @subpackage HTML * * @copyright Copyright (C) 2005 - 2015 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 addresses * * @since 1.5 */ abstract class JHtmlEmail { /** * Simple JavaScript email cloaker * * By default replaces an email with a mailto link with email cloaked * * @param string $mail The -mail address to cloak. * @param boolean $mailto True if text and mailing address differ * @param string $text Text for the link * @param boolean $email True if text is an e-mail address * * @return string The cloaked email. * * @since 1.5 */ public static function cloak($mail, $mailto = true, $text = '', $email = true) { // Convert mail $mail = static::convertEncoding($mail); // Split email by @ symbol $mail = explode('@', $mail); $mail_parts = explode('.', $mail[1]); // Random number $rand = rand(1, 100000); $replacement = '<span id="cloak' . $rand . '">' . JText::_('JLIB_HTML_CLOAKING') . '</span>' . "<script type='text/javascript'>"; $replacement .= "\n //<!--"; $replacement .= "\n document.getElementById('cloak$rand').innerHTML = '';"; $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 address if ($text) { // Convert text - here is the right place $text = static::convertEncoding($text); if ($email) { // 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.getElementById('cloak$rand').innerHTML += '<a ' + path + '\'' + prefix + ':' + addy" . $rand . " + '\'>'+addy_text" . $rand . "+'<\/a>';"; } else { $replacement .= "\n document.getElementById('cloak$rand').innerHTML += '<a ' + path + '\'' + prefix + ':' + addy" . $rand . " + '\'>' +addy" . $rand . "+'<\/a>';"; } } else { $replacement .= "\n document.getElementById('cloak$rand').innerHTML += addy" . $rand . ";"; } $replacement .= "\n //-->"; $replacement .= "\n </script>"; return $replacement; } /** * Convert encoded text * * @param string $text Text to convert * * @return string The converted text. * * @since 1.5 */ protected static function convertEncoding($text) { $text = html_entity_decode($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); $text = htmlentities($text, ENT_QUOTES, 'UTF-8', false); return $text; } }