Module:Navbar: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
m (Changed protection level of Module:Navbar: Highly visible template or Lua module ([Edit=Block all non-admin users] (indefinite) [Move=Block all non-admin users] (indefinite))) |
(handle expensive parser function limit without killing the box) |
||
Line 17: | Line 17: | ||
return tostring(span) |
return tostring(span) |
||
end |
|||
function getTitle( pageName ) |
|||
pageName = trim( pageName ); |
|||
⚫ | |||
⚫ | |||
else |
|||
return mw.title.new( pageName, 'Template' ); |
|||
⚫ | |||
end |
end |
||
Line 24: | Line 33: | ||
end |
end |
||
local title; |
local good, title; |
||
good, title = pcall( getTitle, args[1] ); |
|||
if |
if not good then |
||
return error('Expensive parser function limit exceeded'); |
|||
⚫ | |||
end |
|||
⚫ | |||
⚫ | |||
if not title then |
if not title then |
||
return error('Page does not exist') |
return error('Page does not exist') |