Difference between revisions of "Module:Check for unknown parameters"

Jump to navigation Jump to search
m (Protected Module:Check for unknown parameters: Highly visible page ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite)))
(fix odd bug for | = which gets stripped to nothing, and Category:Foo is broken)
if( (not knownflag) and ( (not ignoreblank) or (ignoreblank and isnotempty(v)) ) ) then
k = mw.ustring.gsub(k, '[^%w\-_ ]', '?')
local r = mw.ustring.gsub(unknown, '_VALUE_ ', k)
table.insert(res, r)
table.insert(comments, '"' .. k .. '"')
elseif(checkpos and type(k) == 'number' and knownargs[tostring(k)] == nil) then
if( (not ignoreblank) or (ignoreblank and isnotempty(v)) ) then
local r = mw.ustring.gsub(unknown, '_VALUE_ ', k)
table.insert(res, r)
table.insert(comments, '"' .. k .. '"')