From cc1fca725c652ac4823da6a294188503079196c9 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Tue, 22 Dec 2009 16:28:50 +0000 Subject: Fixed bug in is_valid_filename when restriction has magic characters. --- lib/validator.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/validator.lua') diff --git a/lib/validator.lua b/lib/validator.lua index a7e807f..ca8ed41 100755 --- a/lib/validator.lua +++ b/lib/validator.lua @@ -165,7 +165,7 @@ function is_port(numstr) end function is_valid_filename ( path, restriction ) - if not (path) or ((restriction) and (string.find (path, "^" .. restriction ) == nil or string.find (path, "/", #restriction+2) )) then + if not (path) or ((restriction) and (string.find (path, "^" .. format.escapemagiccharacters(restriction) ) == nil or string.find (path, "/", #restriction+2) )) then return false end return true -- cgit v1.2.3