{{Support for Apache's mod_env, which deals with UNIX environment variables}}
-extern val setEnv : no_spaces -> no_spaces -> [^Vhost];
+extern val setEnv : no_spaces -> no_newlines -> [^Vhost];
{{See <a href="http://httpd.apache.org/docs/2.0/mod/mod_env.html#setenv">the
Apache documentation</a>.}}
val _ = Env.type_one "no_spaces"
Env.string
- (CharVector.all (fn ch => not (Char.isSpace ch) andalso ch <> #"\"" andalso ch <> #"'"))
+ (CharVector.all (fn ch => Char.isPrint ch andalso not (Char.isSpace ch)
+ andalso ch <> #"\"" andalso ch <> #"'"))
val _ = Env.type_one "no_newlines"
Env.string
- (CharVector.all (fn ch => ch <> #"\n" andalso ch <> #"\r" andalso ch <> #"\"" andalso ch <> #"'"))
+ (CharVector.all (fn ch => Char.isPrint ch andalso ch <> #"\n" andalso ch <> #"\r"
+ andalso ch <> #"\"" andalso ch <> #"'"))
val _ = Env.type_one "ip"
Env.string
(fn (key, value) => (write "\tSetEnv \"";
write key;
write "\" \"";
- write value;
+ write (String.translate (fn #"\"" => "\\\""
+ | ch => str ch) value);
write "\"\n"))
val () = Domain.registerResetLocal (fn () =>