summaryrefslogtreecommitdiff
path: root/src/scriptcheck.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-03-10 11:18:01 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-03-10 11:18:01 -0400
commit998ec0f6506d8b7065fbe277c253188b38bcac7c (patch)
tree99e4bdad36025df9b3bd37c782f9dd36f052307a /src/scriptcheck.sml
parent36b92359be479b92b5adcbdc669576e61d01f74a (diff)
React demo
Diffstat (limited to 'src/scriptcheck.sml')
-rw-r--r--src/scriptcheck.sml8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/scriptcheck.sml b/src/scriptcheck.sml
index bfe87766..fd4f4cd9 100644
--- a/src/scriptcheck.sml
+++ b/src/scriptcheck.sml
@@ -38,8 +38,10 @@ structure IS = IntBinarySet
val csBasis = SS.addList (SS.empty,
["new_client_source",
"get_client_source",
- "set_client_source",
- "alert"])
+ "set_client_source"])
+
+val scriptWords = ["<script",
+ " onclick="]
fun classify (ds, ps) =
let
@@ -54,7 +56,7 @@ fun classify (ds, ps) =
let
fun hasClient e =
case #1 e of
- EPrim (Prim.String s) => inString {needle = "<script", haystack = s}
+ EPrim (Prim.String s) => List.exists (fn n => inString {needle = n, haystack = s}) scriptWords
| EPrim _ => false
| ERel _ => false
| ENamed n => IS.member (csids, n)