Module:IsValidPageName

From Seeds of the Word, the encyclopedia of the influence of the Gospel on culture
Revision as of 12:23, April 2, 2014 by en>Mr. Stradivarius (use pcall in case we are over the expensive function count)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:IsValidPageName/doc

-- 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