Module:Lua banner: Difference between revisions

No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 111: Line 111:
if module ~= "CP:libraryUtil" then
if module ~= "CP:libraryUtil" then
local moduleTitle = mw.title.new(module)
local moduleTitle = mw.title.new(module)
local moduleProt = moduleTitle and moduleTitle.protectionLevels["edit"][1]
local editProtection = moduleTitle and moduleTitle.protectionLevels and moduleTitle.protectionLevels["edit"]
if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end
local moduleProt = editProtection and editProtection[1]
if moduleProt == nil then
moduleProt = 0
else
moduleProt = protLevels[moduleProt] or 0
end
if moduleProt < currentProt then
if moduleProt < currentProt then
cats[#cats + 1] = protCatName
cats[#cats + 1] = protCatName
Line 118: Line 123:
end
end
end
end
end
end
end
end