From 5230f8f8a86fc1ae5d90f8c74ae65c93e197502b Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Thu, 22 Jan 2015 09:14:12 +0100 Subject: Apply namespaces to class inheritances (pt1) --- framework/TJavaScriptLiteral.php | 57 ---------------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 framework/TJavaScriptLiteral.php (limited to 'framework/TJavaScriptLiteral.php') diff --git a/framework/TJavaScriptLiteral.php b/framework/TJavaScriptLiteral.php deleted file mode 100644 index 56dc6e85..00000000 --- a/framework/TJavaScriptLiteral.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * Global Events, intra-object events, Class behaviors, expanded behaviors - * @author Brad Anderson - * - * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2014 PradoSoft - * @license http://www.pradosoft.com/license/ - * @package Prado - */ - -namespace Prado; - -/** - * TJavaScriptLiteral class that encloses string literals that are not - * supposed to be escaped by {@link TJavaScript::encode() } - * - * Since Prado 3.2 all the data that gets sent clientside inside a javascript statement - * is encoded by default to avoid any kind of injection. - * Sometimes there's the need to bypass this encoding and send raw javascript code. - * To ensure that a string doesn't get encoded by {@link TJavaScript::encode() }, - * construct a new TJavaScriptLiteral: - * - * // a javascript test string - * $js="alert('hello')"; - * // the string in $raw will not be encoded when sent clientside inside a javascript block - * $raw=new TJavaScriptLiteral($js); - * // shortened form - * $raw=_js($js); - * - * - * @package Prado - * @since 3.2.0 - */ -class TJavaScriptLiteral -{ - protected $_s; - - public function __construct($s) - { - $this->_s = $s; - } - - public function __toString() - { - return (string)$this->_s; - } - - public function toJavaScriptLiteral() - { - return $this->__toString(); - } -} \ No newline at end of file -- cgit v1.2.3