<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FMatroc%2FTesturlencode</id>
	<title>Module:Sandbox/Matroc/Testurlencode - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FMatroc%2FTesturlencode"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/Matroc/Testurlencode&amp;action=history"/>
	<updated>2026-04-21T06:16:40Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Sandbox/Matroc/Testurlencode&amp;diff=145800&amp;oldid=prev</id>
		<title>imported&gt;Matroc at 00:22, 14 July 2013</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/Matroc/Testurlencode&amp;diff=145800&amp;oldid=prev"/>
		<updated>2013-07-14T00:22:54Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local subtable = {}&lt;br /&gt;
  subtable[1] = &amp;quot; @r+&amp;quot;&lt;br /&gt;
  subtable[2] = &amp;quot;%%3D@r=&amp;quot;                               --  Encode substitutions are done using a table in index order&lt;br /&gt;
  subtable[3] = &amp;quot;%%26@r&amp;amp;&amp;quot;&lt;br /&gt;
  subtable[4] = &amp;quot;%%3A@r:&amp;quot;&lt;br /&gt;
  subtable[5] = &amp;quot;%%2F@r/&amp;quot;&lt;br /&gt;
  subtable[6] = &amp;quot;%%3F@r?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
function p.encode(frame)&lt;br /&gt;
  local lookfor = &amp;quot;&amp;quot;&lt;br /&gt;
  local replace = &amp;quot;&amp;quot;&lt;br /&gt;
  local a_str = frame.args[1] or &amp;quot;&amp;quot;                    -- Get URL to process&lt;br /&gt;
  local link = frame.args[2] or &amp;quot;&amp;quot;                     -- Create a Link if present otherwise return string&lt;br /&gt;
  local option = frame.args[3] or &amp;quot;wikipedia&amp;quot;          -- Dummy argument for future special action&lt;br /&gt;
                                                       -- Assumption that a_str begins with http/https/file etc. otherwise&lt;br /&gt;
                                                       --    might force a_str to have &amp;quot;http://&amp;quot; as leading chars - not included&lt;br /&gt;
                                                       --    at this time&lt;br /&gt;
&lt;br /&gt;
  -- DECODE 1st?&lt;br /&gt;
     a_str = a_str:gsub (&amp;quot;+&amp;quot;, &amp;quot; &amp;quot;)&lt;br /&gt;
     a_str = a_str:gsub (&amp;quot;%%(%x%x)&amp;quot;,&lt;br /&gt;
         function(h) return string.char(tonumber(h,16)) end)&lt;br /&gt;
&lt;br /&gt;
     a_str = string.gsub (a_str,&amp;quot;([^%w %-%_%.%~])&amp;quot;,&lt;br /&gt;
         function (c) return string.format (&amp;quot;%%%02X&amp;quot;, string.byte(c)) end)&lt;br /&gt;
&lt;br /&gt;
     for i = 1 , #subtable, 1 do&lt;br /&gt;
        lookfor = string.gsub(subtable[i],&amp;quot;@r(.*)&amp;quot;,&amp;quot;&amp;quot;)&lt;br /&gt;
        replace = string.gsub(subtable[i],&amp;quot;^(.*)@r&amp;quot;,&amp;quot;&amp;quot;)&lt;br /&gt;
        a_str = a_str:gsub(lookfor,replace)&lt;br /&gt;
 &lt;br /&gt;
       end&lt;br /&gt;
&lt;br /&gt;
     if link ~= &amp;quot;&amp;quot; then&lt;br /&gt;
        a_str = &amp;quot;[&amp;quot; .. a_str .. &amp;quot; &amp;quot; .. link .. &amp;quot;]&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
     return a_str&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Matroc</name></author>
	</entry>
</feed>