Difference between revisions of "Module:ExistNotRedirect"

From blackwiki
Jump to navigation Jump to search
blackwiki>BrownHairedGirl
(Created page with 'local p = {} function p.main(args) local myArgs = mw.getCurrentFrame():getParent().args local myPageName = myArgs[1] if (myPageName == nil) or (myPageName =...')
 
blackwiki>MusikBot II
m (Protected "Module:ExistNotRedirect": High-risk template or module (more info) ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite)))
(No difference)

Revision as of 17:59, 10 July 2019

Implements {{ExistNotRedirect}}


local p = {}


function p.main(args)
	local myArgs = mw.getCurrentFrame():getParent().args
	local myPageName = myArgs[1]
	if (myPageName == nil) or (myPageName == "") then
		return ""
	end

	local mypageTitle = mw.title.makeTitle("", myPageName)
	if mypageTitle.exists then
		if mypageTitle.isRedirect then
			return ""
		else
			return myPageName
		end
	end

	return ""

end

return p