Difference between revisions of "Module:IsValidPageName"

From Postfurry Wiki
Jump to: navigation, search
(use pcall in case we are over the expensive function count)
 
m (1 revision imported)
 
(No difference)

Latest revision as of 16:56, 31 December 2014

-- This module implements [[Template:isValidPageName]].

local export = {}

function export.isValidPageName(frame)
	local success, res = pcall(mw.title.new, frame.args[1])
	if success and res then
		return "valid"
	else
		return ""
	end
end

return export