summaryrefslogtreecommitdiff
path: root/framework/Web/THttpUtility.php
diff options
context:
space:
mode:
authorctrlaltca@gmail.com <>2011-06-26 21:58:28 +0000
committerctrlaltca@gmail.com <>2011-06-26 21:58:28 +0000
commit39a33f34e5229f10b06629515bea69ff03b997f4 (patch)
tree9db35ee2f59b2cd3edd2c269091223763c37fd8c /framework/Web/THttpUtility.php
parent8dc9d4f7d49bcbeaf4998baf74a4f4459967c1f0 (diff)
test patch for #243
Diffstat (limited to 'framework/Web/THttpUtility.php')
-rw-r--r--framework/Web/THttpUtility.php16
1 files changed, 14 insertions, 2 deletions
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 <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2011 PradoSoft
+ * @copyright Copyright &copy; 2005-2011 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web
@@ -22,12 +22,13 @@ class THttpUtility
{
private static $_encodeTable=array('<'=>'&lt;','>'=>'&gt;','"'=>'&quot;');
private static $_decodeTable=array('&lt;'=>'<','&gt;'=>'>','&quot;'=>'"');
+ private static $_stripTable=array('&lt;'=>'','&gt;'=>'','&quot;'=>'');
/**
* 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);
+ }
}