<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.prodigix.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ACheck_for_unknown_parameters</id>
	<title>Module:Check for unknown parameters - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.prodigix.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ACheck_for_unknown_parameters"/>
	<link rel="alternate" type="text/html" href="https://wiki.prodigix.com/index.php?title=Module:Check_for_unknown_parameters&amp;action=history"/>
	<updated>2026-04-04T14:25:27Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.1</generator>
	<entry>
		<id>https://wiki.prodigix.com/index.php?title=Module:Check_for_unknown_parameters&amp;diff=114&amp;oldid=prev</id>
		<title>TylerSmith: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://wiki.prodigix.com/index.php?title=Module:Check_for_unknown_parameters&amp;diff=114&amp;oldid=prev"/>
		<updated>2023-02-20T19:57:30Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:57, 20 February 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>TylerSmith</name></author>
	</entry>
	<entry>
		<id>https://wiki.prodigix.com/index.php?title=Module:Check_for_unknown_parameters&amp;diff=113&amp;oldid=prev</id>
		<title>2001:E68:5DB6:4400:1CC9:6BF6:F04B:8803: Created page with &quot;-- This module may be used to compare the arguments passed to the parent -- with a list of arguments, returning a specified result if an argument is -- not on the list local p...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.prodigix.com/index.php?title=Module:Check_for_unknown_parameters&amp;diff=113&amp;oldid=prev"/>
		<updated>2016-04-29T02:05:33Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;-- This module may be used to compare the arguments passed to the parent -- with a list of arguments, returning a specified result if an argument is -- not on the list local p...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module may be used to compare the arguments passed to the parent&lt;br /&gt;
-- with a list of arguments, returning a specified result if an argument is&lt;br /&gt;
-- not on the list&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function trim(s)&lt;br /&gt;
	return s:match(&amp;#039;^%s*(.-)%s*$&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function isnotempty(s)&lt;br /&gt;
	return s and trim(s) ~= &amp;#039;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.check (frame)&lt;br /&gt;
	local args = frame.args&lt;br /&gt;
	local pargs = frame:getParent().args&lt;br /&gt;
	local ignoreblank = isnotempty(frame.args[&amp;#039;ignoreblank&amp;#039;])&lt;br /&gt;
	local checkpos = isnotempty(frame.args[&amp;#039;checkpositional&amp;#039;])&lt;br /&gt;
	local knownargs = {}&lt;br /&gt;
	local unknown = frame.args[&amp;#039;unknown&amp;#039;] or &amp;#039;Found _VALUE_, &amp;#039;&lt;br /&gt;
	local preview = frame.args[&amp;#039;preview&amp;#039;]&lt;br /&gt;
&lt;br /&gt;
	local res = {}&lt;br /&gt;
	local regexps = {}&lt;br /&gt;
	local comments = {}&lt;br /&gt;
	local commentstr = &amp;#039;&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
	local ispreview = frame:preprocess( &amp;quot;{{REVISIONID}}&amp;quot; ) == &amp;quot;&amp;quot; and 1 or 0&lt;br /&gt;
&lt;br /&gt;
	-- create the list of known args, regular expressions, and the return string&lt;br /&gt;
	for k, v in pairs(args) do&lt;br /&gt;
		if type(k) == &amp;#039;number&amp;#039; then&lt;br /&gt;
			v = trim(v)&lt;br /&gt;
			knownargs[v] = 1&lt;br /&gt;
		elseif k:find(&amp;#039;^regexp[1-9][0-9]*$&amp;#039;) then&lt;br /&gt;
			table.insert(regexps, &amp;#039;^&amp;#039; .. v .. &amp;#039;$&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if isnotempty(preview) then &lt;br /&gt;
		preview = &amp;#039;&amp;lt;div class=&amp;quot;hatnote&amp;quot; style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;Warning:&amp;lt;/strong&amp;gt; &amp;#039; .. preview .. &amp;#039; (this message is shown only in preview).&amp;lt;/div&amp;gt;&amp;#039;&lt;br /&gt;
	elseif preview == nil then&lt;br /&gt;
		preview = unknown&lt;br /&gt;
	end&lt;br /&gt;
	if ispreview == 1 then &lt;br /&gt;
		unknown = preview&lt;br /&gt;
		ignoreblank = false&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- adds one result to the output tables&lt;br /&gt;
	local function addresult(k)&lt;br /&gt;
		if k == &amp;#039;&amp;#039; then&lt;br /&gt;
			-- Fix odd bug for | = which gets stripped to the empty string and&lt;br /&gt;
			-- breaks category links&lt;br /&gt;
			k = &amp;#039; &amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
		local r = unknown:gsub(&amp;#039;_VALUE_&amp;#039;, k)&lt;br /&gt;
		table.insert(res, r)&lt;br /&gt;
		table.insert(comments, &amp;#039;&amp;quot;&amp;#039; .. k .. &amp;#039;&amp;quot;&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- loop over the parent args, and make sure they are on the list&lt;br /&gt;
	for k, v in pairs(pargs) do&lt;br /&gt;
		if type(k) == &amp;#039;string&amp;#039; and knownargs[k] == nil then&lt;br /&gt;
			local knownflag = false&lt;br /&gt;
			for i, regexp in ipairs(regexps) do&lt;br /&gt;
				if mw.ustring.match(k, regexp) then&lt;br /&gt;
					knownflag = true&lt;br /&gt;
					break&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			if not knownflag and ( not ignoreblank or isnotempty(v) )  then&lt;br /&gt;
				k = mw.ustring.gsub(k, &amp;#039;[^%w\-_ ]&amp;#039;, &amp;#039;?&amp;#039;)&lt;br /&gt;
				addresult(k)&lt;br /&gt;
			end&lt;br /&gt;
		elseif checkpos and&lt;br /&gt;
			type(k) == &amp;#039;number&amp;#039; and &lt;br /&gt;
			knownargs[tostring(k)] == nil and&lt;br /&gt;
			( not ignoreblank or isnotempty(v) )&lt;br /&gt;
		then&lt;br /&gt;
			addresult(k)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if #comments &amp;gt; 0 then&lt;br /&gt;
		commentstr = &amp;#039;&amp;lt;!-- Module:Check for unknown parameters results: &amp;#039; ..&lt;br /&gt;
			table.concat(comments, &amp;#039;, &amp;#039;) .. &amp;#039;--&amp;gt;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return table.concat(res) .. commentstr&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>2001:E68:5DB6:4400:1CC9:6BF6:F04B:8803</name></author>
	</entry>
</feed>