scripts/check_site.lua: print proper error message for non-string keys in need_alphanumeric_key()
This commit is contained in:
parent
951b6632bc
commit
b7be32d9f4
@ -217,8 +217,8 @@ end
|
|||||||
function need_alphanumeric_key(path)
|
function need_alphanumeric_key(path)
|
||||||
local val = path[#path]
|
local val = path[#path]
|
||||||
-- We don't use character classes like %w here to be independent of the locale
|
-- We don't use character classes like %w here to be independent of the locale
|
||||||
if not val:match('^[0-9a-zA-Z_]+$') then
|
if type(val) ~= 'string' or not val:match('^[0-9a-zA-Z_]+$') then
|
||||||
var_error(path, val, 'have a key using only alphanumeric characters and underscores')
|
var_error(path, val, 'have a string key using only alphanumeric characters and underscores')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user