Merge pull request #2806 from dibdot/magic
system-wide: fix escaping of magic chars
This commit is contained in:
commit
1fad6c0eed
3 changed files with 4 additions and 5 deletions
|
@ -26,7 +26,7 @@ pwd.password = false
|
|||
|
||||
function pwd.write(self, section, value)
|
||||
local pass
|
||||
if string.match(value, "^\$%d\$.*") then
|
||||
if string.match(value, "^%$%d%$.*") then
|
||||
pass = value
|
||||
else
|
||||
local t = tonumber(nixio.getpid()*os.time())
|
||||
|
|
|
@ -418,7 +418,7 @@ function maxlength(val, max)
|
|||
end
|
||||
|
||||
function phonedigit(val)
|
||||
return (val:match("^[0-9\*#!%.]+$") ~= nil)
|
||||
return (val:match("^[0-9%*#!%.]+$") ~= nil)
|
||||
end
|
||||
|
||||
function timehhmmss(val)
|
||||
|
|
|
@ -207,9 +207,8 @@ end
|
|||
-- handling. It may actually be a property of the getopt function
|
||||
-- rather than the shell proper.
|
||||
function shellstartsqescape(value)
|
||||
res, _ = string.gsub(value, "^\-", "\\-")
|
||||
res, _ = string.gsub(res, "^-", "\-")
|
||||
return shellsqescape(value)
|
||||
res, _ = string.gsub(value, "^%-", "\\-")
|
||||
return shellsqescape(res)
|
||||
end
|
||||
|
||||
-- containing the resulting substrings. The optional max parameter specifies
|
||||
|
|
Loading…
Reference in a new issue