diff src/luan/host/main.luan @ 1422:e48290f3d9fb

better quoting
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 17 Nov 2019 16:28:51 -0700
parents 732b5de211fc
children d9a5405a3102
line wrap: on
line diff
--- a/src/luan/host/main.luan	Sat Oct 26 22:28:46 2019 -0600
+++ b/src/luan/host/main.luan	Sun Nov 17 16:28:51 2019 -0700
@@ -8,7 +8,7 @@
 local Rpc = require "luan:Rpc.luan"
 local Thread = require "luan:Thread.luan"
 local String = require "luan:String.luan"
-local literal = String.literal or error()
+local regex_quote = String.regex_quote or error()
 local lower = String.lower or error()
 local matches = String.matches or error()
 local Hosted = require "luan:host/Hosted.luan"
@@ -114,7 +114,7 @@
 end
 
 local function security(site_dir,file)
-	matches( file.to_string(), "^"..literal(site_dir.to_string()) ) or error "security violation"
+	matches( file.to_string(), "^"..regex_quote(site_dir.to_string()) ) or error "security violation"
 end
 
 function fns.copy_file(domain,password,dir,name,content)