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)
|
function pwd.write(self, section, value)
|
||||||
local pass
|
local pass
|
||||||
if string.match(value, "^\$%d\$.*") then
|
if string.match(value, "^%$%d%$.*") then
|
||||||
pass = value
|
pass = value
|
||||||
else
|
else
|
||||||
local t = tonumber(nixio.getpid()*os.time())
|
local t = tonumber(nixio.getpid()*os.time())
|
||||||
|
|
|
@ -418,7 +418,7 @@ function maxlength(val, max)
|
||||||
end
|
end
|
||||||
|
|
||||||
function phonedigit(val)
|
function phonedigit(val)
|
||||||
return (val:match("^[0-9\*#!%.]+$") ~= nil)
|
return (val:match("^[0-9%*#!%.]+$") ~= nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
function timehhmmss(val)
|
function timehhmmss(val)
|
||||||
|
|
|
@ -207,9 +207,8 @@ end
|
||||||
-- handling. It may actually be a property of the getopt function
|
-- handling. It may actually be a property of the getopt function
|
||||||
-- rather than the shell proper.
|
-- rather than the shell proper.
|
||||||
function shellstartsqescape(value)
|
function shellstartsqescape(value)
|
||||||
res, _ = string.gsub(value, "^\-", "\\-")
|
res, _ = string.gsub(value, "^%-", "\\-")
|
||||||
res, _ = string.gsub(res, "^-", "\-")
|
return shellsqescape(res)
|
||||||
return shellsqescape(value)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- containing the resulting substrings. The optional max parameter specifies
|
-- containing the resulting substrings. The optional max parameter specifies
|
||||||
|
|
Loading…
Reference in a new issue