From 39a33f34e5229f10b06629515bea69ff03b997f4 Mon Sep 17 00:00:00 2001 From: "ctrlaltca@gmail.com" <> Date: Sun, 26 Jun 2011 21:58:28 +0000 Subject: test patch for #243 --- framework/Web/THttpUtility.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'framework/Web/THttpUtility.php') diff --git a/framework/Web/THttpUtility.php b/framework/Web/THttpUtility.php index 6a39b91f..0e81af56 100644 --- a/framework/Web/THttpUtility.php +++ b/framework/Web/THttpUtility.php @@ -4,7 +4,7 @@ * * @author Qiang Xue * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2011 PradoSoft + * @copyright Copyright © 2005-2011 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Web @@ -22,12 +22,13 @@ class THttpUtility { private static $_encodeTable=array('<'=>'<','>'=>'>','"'=>'"'); private static $_decodeTable=array('<'=>'<','>'=>'>','"'=>'"'); + private static $_stripTable=array('<'=>'','>'=>'','"'=>''); /** * HTML-encodes a string. * This method translates the following characters to their corresponding * HTML entities: <, >, " - * Note, unlike {@link htmlspeicalchars}, & is not translated. + * Note, unlike {@link htmlspecialchars}, & is not translated. * @param string string to be encoded * @return string encoded string */ @@ -46,5 +47,16 @@ class THttpUtility { return strtr($s,self::$_decodeTable); } + + /** + * This method strips the following characters from a string: + * HTML entities: <, >, " + * @param string string to be encoded + * @return string encoded string + */ + public static function htmlStrip($s) + { + return strtr($s,self::$_stripTable); + } } -- cgit v1.2.3