diff options
author | Ted Trask <ttrask01@yahoo.com> | 2008-08-20 19:02:04 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2008-08-20 19:02:04 +0000 |
commit | f946b0f29f0a0806bb745bbe24148fe09970bc82 (patch) | |
tree | d21979e795516b7d0563f494f8d6d6eb34623da9 | |
parent | 3a741f2afb19131acaff8f26d6e863cf72a25be3 (diff) | |
download | acf-core-f946b0f29f0a0806bb745bbe24148fe09970bc82.tar.bz2 acf-core-f946b0f29f0a0806bb745bbe24148fe09970bc82.tar.xz |
Modified validator to not allow '/' characters when checking is_valid_filename with a path restriction.
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1387 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rwxr-xr-x | lib/validator.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/validator.lua b/lib/validator.lua index afea72c..69797fb 100755 --- a/lib/validator.lua +++ b/lib/validator.lua @@ -217,7 +217,7 @@ function is_port(numstr) end function is_valid_filename ( path, restriction ) - if not (path) or ((restriction) and (string.find (path, "^" .. restriction ) == nil)) then + if not (path) or ((restriction) and (string.find (path, "^" .. restriction ) == nil or string.find (path, "/", #restriction+2) )) then return false, "* " .. validator.msg.err.FileInvalidPath1[lang.Current] .. "\n* ".. validator.msg.err.FileInvalidPath2[lang.Current] .. ":" .. string.format(restriction) end |