diff options
Diffstat (limited to 'framework/Web/THttpUtility.php')
-rw-r--r-- | framework/Web/THttpUtility.php | 11 |
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 |