| 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 : /inetpub/wwwroot/icd/administrator/components/com_akeeba/helpers/ |
Upload File : |
<?php
/**
* @package AkeebaBackup
* @copyright Copyright (c)2006-2011 Nicholas K. Dionysopoulos
* @license GNU General Public License version 3, or later
* @version $Id: escape.php 409 2011-01-24 09:30:22Z nikosdion $
* @since 3.0.1
*/
defined('_JEXEC') or die('Restricted access');
class AkeebaHelperEscape
{
/**
* Escapes a string gotten from JText::_() for use with Javascript
* @param $string string The string to escape
* @param $extras string The characters to escape
* @return string
*/
static function escapeJS($string, $extras = '')
{
static $gpc = null;
if(is_null($gpc))
{
// Fetch the state of Magic Quotes GPC
if(function_exists('magic_quotes_gpc')) {
$gpc = magic_quotes_gpc();
} else {
$gpc = false;
}
}
// Make sure we escape single quotes, slashes and brackets
if(empty($extras)) $extras = "'\\[]";
if($gpc) {
// When Magic Quotes GPC is on, the string is already escaped, so...
$string = stripslashes($string);
}
return addcslashes($string, $extras);
}
}