Jump to content

Module:Check for unknown parameters: Difference between revisions

less aggressive encoding per request on the talk page
imported>Sau226
m (1 revision imported: Mass importing office templates & modules)
(less aggressive encoding per request on the talk page)
Line 51: Line 51:
end
end
if not knownflag and ( not ignoreblank or isnotempty(v) )  then
if not knownflag and ( not ignoreblank or isnotempty(v) )  then
k = mw.ustring.gsub(k, '[^%w\-_ ]', '?')
k = mw.text.encode(mw.text.encode(k),'%c%[%]=')
table.insert(values, k)
table.insert(values, k)
end
end
Line 60: Line 60:
local vlen = mw.ustring.len(v)
local vlen = mw.ustring.len(v)
v = mw.ustring.sub(v, 1, (vlen < 25) and vlen or 25)  
v = mw.ustring.sub(v, 1, (vlen < 25) and vlen or 25)  
v = mw.ustring.gsub(v, '[^%w\-_ ]', '?')
v = mw.text.encode(mw.text.encode(v),'%c%[%]=')
table.insert(values, k .. ' = ' .. v .. ((vlen >= 25) and ' ...' or ''))
table.insert(values, k .. ' = ' .. v .. ((vlen >= 25) and ' ...' or ''))
end
end
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.