diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-12-10 13:32:09 -0500 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-12-10 13:32:09 -0500 |
commit | b04e123d0e1159d431aae00c3e8f1cc4a1b95684 (patch) | |
tree | 0f8fb3c5e3f1278843704633e53f27ec20e49b06 /src/mono_opt.sml | |
parent | 14163f6e6e160694eff3d409ca3cf0b8b76c4a3a (diff) |
Basis.url and redirects
Diffstat (limited to 'src/mono_opt.sml')
-rw-r--r-- | src/mono_opt.sml | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mono_opt.sml b/src/mono_opt.sml index eb4f5811..5d81d24d 100644 --- a/src/mono_opt.sml +++ b/src/mono_opt.sml @@ -115,6 +115,8 @@ fun unAs s = doChars (String.explode s, []) end +fun checkUrl s = CharVector.all Char.isGraph s andalso Settings.checkUrl s + fun exp e = case e of EPrim (Prim.String s) => @@ -405,11 +407,16 @@ fun exp e = optExp (EApp (e2, e1), loc) | EFfiApp ("Basis", "bless", [(se as EPrim (Prim.String s), loc)]) => - (if Settings.checkUrl s then + (if checkUrl s then () else ErrorMsg.errorAt loc ("Invalid URL " ^ s ^ " passed to 'bless'"); se) + | EFfiApp ("Basis", "checkUrl", [(se as EPrim (Prim.String s), loc)]) => + (if checkUrl s then + ESome ((TFfi ("Basis", "string"), loc), (se, loc)) + else + ENone (TFfi ("Basis", "string"), loc)) | EFfiApp ("Basis", "blessMime", [(se as EPrim (Prim.String s), loc)]) => (if Settings.checkMime s then () |