<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://elite.mistflux.co.uk/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AUser_name_utils</id>
	<title>Module:User name utils - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://elite.mistflux.co.uk/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AUser_name_utils"/>
	<link rel="alternate" type="text/html" href="https://elite.mistflux.co.uk/w/index.php?title=Module:User_name_utils&amp;action=history"/>
	<updated>2026-10-31T22:22:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://elite.mistflux.co.uk/w/index.php?title=Module:User_name_utils&amp;diff=115486&amp;oldid=prev</id>
		<title>Wikipedia&gt;Ahecht: Protected &quot;Module:User name utils&quot;: High-risk template or module ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</title>
		<link rel="alternate" type="text/html" href="https://elite.mistflux.co.uk/w/index.php?title=Module:User_name_utils&amp;diff=115486&amp;oldid=prev"/>
		<updated>2026-09-10T13:46:15Z</updated>

		<summary type="html">&lt;p&gt;Protected &amp;quot;&lt;a href=&quot;/wiki/Module:User_name_utils&quot; title=&quot;Module:User name utils&quot;&gt;Module:User name utils&lt;/a&gt;&amp;quot;: &lt;a href=&quot;/w/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 template or module&lt;/a&gt; ([Edit=Require template editor access] (indefinite) [Move=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;-- Lua implementation of mediawiki/core/+/refs/heads/master/includes/User/UserNameUtils.php&lt;br /&gt;
-- with the default RIGOR_VALID option&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local IPV4_ADDRESS = &amp;quot;%d%d?%d?%.%d%d?%d?%.%d%d?%d?%.%d%d?%d?&amp;quot;&lt;br /&gt;
local lang = mw.getContentLanguage()&lt;br /&gt;
&lt;br /&gt;
function p._getCanonical(name)&lt;br /&gt;
	if (name or &amp;#039;&amp;#039;) == &amp;#039;&amp;#039; then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- force usernames to capital&lt;br /&gt;
	name = lang:ucfirst(name)&lt;br /&gt;
	&lt;br /&gt;
	-- Reject names containing &amp;#039;#&amp;#039;; these will be cleaned up&lt;br /&gt;
    -- with title normalisation, but then it&amp;#039;s too late to&lt;br /&gt;
    -- check elsewhere&lt;br /&gt;
	if mw.ustring.match(name, &amp;quot;#&amp;quot;) then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Clean up name according to title rules&lt;br /&gt;
	local title = mw.title.new(name,2)&lt;br /&gt;
&lt;br /&gt;
	-- Check for invalid titles&lt;br /&gt;
	if title == nil or title.namespace ~= 2 or title.isExternal then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	name = title.text&lt;br /&gt;
&lt;br /&gt;
	return p._isValid(name) and name or false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._isValid(name)&lt;br /&gt;
	if (name or &amp;#039;&amp;#039;) == &amp;#039;&amp;#039; or&lt;br /&gt;
		require(&amp;#039;Module:IPAddress&amp;#039;)._isIpOrRange(name) ~= &amp;quot;&amp;quot; or&lt;br /&gt;
		mw.ustring.match(name, &amp;quot;^&amp;quot; .. IPV4_ADDRESS .. &amp;quot;$&amp;quot;) or -- anyIPv4, even if invalid&lt;br /&gt;
		mw.ustring.match(name, &amp;quot;^&amp;quot; .. IPV4_ADDRESS .. &amp;quot;-&amp;quot; .. IPV4_ADDRESS .. &amp;quot;$&amp;quot;) or -- isLikeIPv4DashRange&lt;br /&gt;
		mw.ustring.match(name, &amp;quot;/&amp;quot;) or&lt;br /&gt;
		name ~= lang:ucfirst(name) then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Ensure that the name can&amp;#039;t be misresolved as a different title,&lt;br /&gt;
    -- such as with extra namespace keys at the start.&lt;br /&gt;
	local title = mw.title.new(name)&lt;br /&gt;
	if not title or&lt;br /&gt;
		title.namespace ~= 0 or&lt;br /&gt;
		name ~= title.text then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return true	&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.getCanonical(frame)&lt;br /&gt;
	local name = p._getCanonical(frame.args[1])&lt;br /&gt;
	return name and name or &amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.isValid(frame)&lt;br /&gt;
	return p._isValid(frame.args[1]) and &amp;quot;1&amp;quot; or &amp;quot;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Wikipedia&gt;Ahecht</name></author>
	</entry>
</feed>