Module:Redirect hatnote: Difference between revisions

From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
m
Protected "Module:Redirect hatnote": High traffic page ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
(Updated module from sandbox. Removes dependency on Module:Redirect, and introduces more fine-grained categorization for redirect problems.)
m (Protected "Module:Redirect hatnote": High traffic page ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
 
(4 intermediate revisions by 3 users not shown)
Line 13:
 
local p = {}
 
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
 
local function getTitle(...)
--Calls mw.title.new and returns either a title object, or nil on error
local success, titleObj = pcall(mw.title.new, ...)
ifreturn success thenand titleObj or nil
return titleObj
else
return nil
end
end
 
--------------------------------------------------------------------------------
-- Main functions
--------------------------------------------------------------------------------
 
function p.redirect(frame)
Line 59 ⟶ 64:
local formattedRedirect = {}
for k,v in pairs(redirect) do
formattedRedirect[k] = '"' mHatnote.. quote(v .. '"')
end
local text = {
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu