<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://projectmailer.net/index.php?action=history&amp;feed=atom&amp;title=Module%3AIPAddress</id>
	<title>Module:IPAddress - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://projectmailer.net/index.php?action=history&amp;feed=atom&amp;title=Module%3AIPAddress"/>
	<link rel="alternate" type="text/html" href="https://projectmailer.net/index.php?title=Module:IPAddress&amp;action=history"/>
	<updated>2026-04-23T13:43:48Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>https://projectmailer.net/index.php?title=Module:IPAddress&amp;diff=6651&amp;oldid=prev</id>
		<title>Grlucas: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://projectmailer.net/index.php?title=Module:IPAddress&amp;diff=6651&amp;oldid=prev"/>
		<updated>2019-04-09T18:26:50Z</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;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 14:26, 9 April 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&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;!-- diff cache key projectmailer-mw5w_:diff:1.41:old-6650:rev-6651 --&gt;
&lt;/table&gt;</summary>
		<author><name>Grlucas</name></author>
	</entry>
	<entry>
		<id>https://projectmailer.net/index.php?title=Module:IPAddress&amp;diff=6650&amp;oldid=prev</id>
		<title>en&gt;MusikAnimal: Protected &quot;Module:IPAddress&quot;: High-risk module ([Edit=Require template editor access] (indefinite))</title>
		<link rel="alternate" type="text/html" href="https://projectmailer.net/index.php?title=Module:IPAddress&amp;diff=6650&amp;oldid=prev"/>
		<updated>2017-10-10T17:19:53Z</updated>

		<summary type="html">&lt;p&gt;Protected &amp;quot;&lt;a href=&quot;/pm/Module:IPAddress&quot; title=&quot;Module:IPAddress&quot;&gt;Module:IPAddress&lt;/a&gt;&amp;quot;: &lt;a href=&quot;/index.php?title=WP:High-risk_templates&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;WP:High-risk templates (page does not exist)&quot;&gt;High-risk module&lt;/a&gt; ([Edit=Require template editor access] (indefinite))&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--[=[&lt;br /&gt;
Functions are not &amp;quot;local&amp;quot;, so other modules can require this module and call them directly.&lt;br /&gt;
We return an object with 3 small stub functions to call the real ones so that the functions&lt;br /&gt;
can be called from templates also.&lt;br /&gt;
&lt;br /&gt;
Only [[dotted decimal]] notation for IPv4 supported. Does not support&lt;br /&gt;
dotted hexadecimal, dotted octal, or single-number formats (see [[IPv4#Address_representations]]).&lt;br /&gt;
&lt;br /&gt;
Unit tests at Module:IPAddress/tests&lt;br /&gt;
]=]&lt;br /&gt;
&lt;br /&gt;
function _isIpV6( s )&lt;br /&gt;
    local dcolon, groups&lt;br /&gt;
    if type( s ) ~= &amp;quot;string&amp;quot;&lt;br /&gt;
        or s:len() == 0&lt;br /&gt;
        or s:find( &amp;quot;[^:%x]&amp;quot; ) -- only colon and hex digits are legal chars&lt;br /&gt;
        or s:find( &amp;quot;^:[^:]&amp;quot; ) -- can begin or end with :: but not with single :&lt;br /&gt;
        or s:find( &amp;quot;[^:]:$&amp;quot; )&lt;br /&gt;
        or s:find( &amp;quot;:::&amp;quot; )&lt;br /&gt;
    then&lt;br /&gt;
        return false&lt;br /&gt;
    end &lt;br /&gt;
    s, dcolon = s:gsub( &amp;quot;::&amp;quot;, &amp;quot;:&amp;quot; )&lt;br /&gt;
    if dcolon &amp;gt; 1 then return false end -- at most one ::&lt;br /&gt;
    s = s:gsub( &amp;quot;^:?&amp;quot;, &amp;quot;:&amp;quot; ) -- prepend : if needed, upper&lt;br /&gt;
    s, groups = s:gsub( &amp;quot;:%x%x?%x?%x?&amp;quot;, &amp;quot;&amp;quot; ) -- remove valid groups, and count them&lt;br /&gt;
    return ( ( dcolon == 1 and groups &amp;lt; 8 ) or ( dcolon == 0 and groups == 8 ) )&lt;br /&gt;
        and ( s:len() == 0 or ( dcolon == 1 and s == &amp;quot;:&amp;quot; ) ) -- might be one dangling : if original ended with ::&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _isIpV4( s )&lt;br /&gt;
    local function legal( n ) return ( tonumber( n ) or 256 ) &amp;lt; 256  and not n:match(&amp;quot;^0%d&amp;quot;) end-- in lua 0 is true!&lt;br /&gt;
    &lt;br /&gt;
    if type( s ) ~= &amp;quot;string&amp;quot; then return false end&lt;br /&gt;
    local p1, p2, p3, p4 = s:match( &amp;quot;^(%d+)%.(%d+)%.(%d+)%.(%d+)$&amp;quot; ) &lt;br /&gt;
    return legal( p1 ) and legal( p2 ) and legal( p3 ) and legal( p4 )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _isIp( s )&lt;br /&gt;
    return _isIpV4( s ) and &amp;quot;4&amp;quot; or _isIpV6( s ) and &amp;quot;6&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.isIpV6(frame) return _isIpV6( frame.args[ 1 ] ) and &amp;quot;1&amp;quot; or &amp;quot;0&amp;quot; end&lt;br /&gt;
function p.isIpV4(frame) return _isIpV4( frame.args[ 1 ] ) and &amp;quot;1&amp;quot; or &amp;quot;0&amp;quot; end&lt;br /&gt;
function p.isIp(frame) return _isIp( frame.args[ 1 ] ) or &amp;quot;&amp;quot; end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>en&gt;MusikAnimal</name></author>
	</entry>
</feed>