HEX
Server: Apache/2.4.65 (Debian)
System: Linux kubikelcreative 5.10.0-35-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64
User: www-data (33)
PHP: 8.4.13
Disabled: NONE
Upload Files
File: /var/www/gosurya-id/wp-content/plugins/akeebabackupwp/app/Solo/Helper/Escape.php
<?php
/**
 * @package   solo
 * @copyright Copyright (c)2014-2021 Nicholas K. Dionysopoulos / Akeeba Ltd
 * @license   GNU General Public License version 3, or later
 */

namespace Solo\Helper;

/**
 * A helper class to escape JSON data
 */
class Escape
{
	/**
	 * Escapes a string returned from Text::_() for use with Javascript
	 *
	 * @param   $string  string  The string to escape
	 * @param   $extras  string  The characters to escape
	 *
	 * @return  string  The escaped string
	 */
	static function escapeJS($string, $extras = '')
	{
		// Make sure we escape single quotes, slashes and brackets
		if (empty($extras))
		{
			$extras = "'\\[]\"";
		}

		return addcslashes($string, $extras);
	}
}