Module:Lua banner: Difference between revisions
m Protected "Module:Lua banner": Highrisk ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)) [cascading] |
m Fix syntax issue |
||
| (One intermediate revision by the same user not shown) | |||
| Line 111: | Line 111: | ||
if module ~= "WP:libraryUtil" then | if module ~= "WP:libraryUtil" then | ||
local moduleTitle = mw.title.new(module) | local moduleTitle = mw.title.new(module) | ||
local moduleProt = moduleTitle and moduleTitle.protectionLevels["edit"][1] | local editLevel = moduleTitle.protectionLevels["edit"] | ||
local moduleProt = 0 | |||
if editLevel == nil then moduleProt = 0 else | |||
moduleProt = moduleTitle and moduleTitle.protectionLevels["edit"][1] | |||
if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end | |||
if moduleProt < currentProt then | |||
cats[#cats + 1] = protCatName | |||
break | |||
end | |||
end | end | ||
end | end | ||