Modul:Check for unknown parameters: Unterschied zwischen den Versionen
Modul:Check for unknown parameters (Quelltext anzeigen)
Version vom 30. Oktober 2015, 16:01 Uhr
, vor 10 Jahrenfix odd bug for | = which gets stripped to nothing, and Category:Foo is broken
K (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) |
||
| Zeile 46: | Zeile 46: | ||
if( (not knownflag) and ( (not ignoreblank) or (ignoreblank and isnotempty(v)) ) ) then | if( (not knownflag) and ( (not ignoreblank) or (ignoreblank and isnotempty(v)) ) ) then | ||
k = mw.ustring.gsub(k, '[^%w\-_ ]', '?') | k = mw.ustring.gsub(k, '[^%w\-_ ]', '?') | ||
local r = mw.ustring.gsub(unknown, '_VALUE_', k) | local r = mw.ustring.gsub(unknown, '_VALUE_ ', k) | ||
table.insert(res, r) | table.insert(res, r) | ||
table.insert(comments, '"' .. k .. '"') | table.insert(comments, '"' .. k .. '"') | ||
| Zeile 52: | Zeile 52: | ||
elseif(checkpos and type(k) == 'number' and knownargs[tostring(k)] == nil) then | elseif(checkpos and type(k) == 'number' and knownargs[tostring(k)] == nil) then | ||
if( (not ignoreblank) or (ignoreblank and isnotempty(v)) ) then | if( (not ignoreblank) or (ignoreblank and isnotempty(v)) ) then | ||
local r = mw.ustring.gsub(unknown, '_VALUE_', k) | local r = mw.ustring.gsub(unknown, '_VALUE_ ', k) | ||
table.insert(res, r) | table.insert(res, r) | ||
table.insert(comments, '"' .. k .. '"') | table.insert(comments, '"' .. k .. '"') | ||