Jump to content

Module:Urldecode

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Psiĥedelisto (talk | contribs) at 13:44, 30 June 2020 (Initial version copied from https://en.wikinews.org/w/index.php?title=Module:Urldecode. See that page's history for attribution.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

local p = {}

function p.urlDecode( frame )
	local enctype = frame.args[2]
	if (frame.args[2] ~= nil) then
		enctype = mw.ustring.upper(enctype)
		if ((enctype == "QUERY") or (enctype == "PATH") or (enctype == "WIKI")) then
			return (mw.uri.decode(frame.args[1],frame.args[2]))
		end
	end
	return (mw.uri.decode(frame.args[1]))
end

return p