summaryrefslogtreecommitdiff
path: root/framework/Web/THttpUtility.php
diff options
context:
space:
mode:
authorxue <>2005-12-05 13:57:49 +0000
committerxue <>2005-12-05 13:57:49 +0000
commit703b3edacfbb12b57510d1ca441b6bbbb2fc16ab (patch)
tree9cdffc4d80faef0646fab2f5a404c9a20a3d91d2 /framework/Web/THttpUtility.php
parentf2cb7a3cf82f4788e4e96bd42fa617d6ea8e0fb0 (diff)
Diffstat (limited to 'framework/Web/THttpUtility.php')
-rw-r--r--framework/Web/THttpUtility.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/framework/Web/THttpUtility.php b/framework/Web/THttpUtility.php
index 9d2aa7b2..7cb1c01c 100644
--- a/framework/Web/THttpUtility.php
+++ b/framework/Web/THttpUtility.php
@@ -28,6 +28,17 @@ class THttpUtility
else
return strtr($js,array("\t"=>'\t',"\n"=>'\n',"\r"=>'\r','"'=>'\"','\''=>'\\\'','\\'=>'\\\\'));
}
+
+ public static function trimJavaScriptString($js)
+ {
+ if($js!=='' && $js!==null)
+ {
+ if(($pos=strpos($js,'javascript:'))===0)
+ $js=substr($js,11);
+ $js=rtrim($js,';').';';
+ }
+ return $js;
+ }
}
?> \ No newline at end of file