وحدة:ExistNotRedirect

من أرابيكا، الموسوعة الحرة

هذه هي النسخة الحالية من هذه الصفحة، وقام بتعديلها عبود السكاف (نقاش | مساهمات) في 23:22، 20 فبراير 2021 (أنشأ الصفحة ب'local p = {} function p.main(args) local myArgs = mw.getCurrentFrame():getParent().args local myPageName = myArgs[1] local forceFileOnly = myArgs.forcefile -- force...'). العنوان الحالي (URL) هو وصلة دائمة لهذه النسخة.

(فرق) → نسخة أقدم | نسخة حالية (فرق) | نسخة أحدث ← (فرق)
اذهب إلى التنقل اذهب إلى البحث
local p = {}

function p.main(args)
	local myArgs = mw.getCurrentFrame():getParent().args
	local myPageName = myArgs[1]
	local forceFileOnly = myArgs.forcefile -- force File: namespace check only
	
	if not myPageName or myPageName == "" then
		return ""
	end
	
	local myPageTitle = mw.title.makeTitle("", myPageName)
	if not myPageTitle then
		error("Invalid page title passed, MediaWiki cannot understand it", 1)
	end
	if myPageTitle.exists
		or not forceFileOnly and myPageTitle.file and myPageTitle.file.exists
	then
		if not myPageTitle.isRedirect then
			return myArgs[1]
		end
	end
	
	return ""
end

return p