Modul:UrlCheck: Unterschied zwischen den Versionen

Ergebnis uc.ip4 angepasst
(Wartung)
(Ergebnis uc.ip4 angepasst)
Zeile 33: Zeile 33:
for _, value in pairs( parts ) do
for _, value in pairs( parts ) do
if tonumber( value ) < 0 or tonumber( value ) > 255 then
if tonumber( value ) < 0 or tonumber( value ) > 255 then
return 0
return false
end
end
end
end
return 1 -- ok
return true -- ok
end
end
return 0
return false
end
end


Zeile 153: Zeile 153:
-- future: check of top-level domain
-- future: check of top-level domain


if uc.ip4( host ) == 1 then -- is ip4 address
if uc.ip4( host ) then -- is ip4 address
return 2
return 2
elseif not mw.ustring.match( host, '^[%w%.%-]+%.%a%a+$' ) then
elseif not mw.ustring.match( host, '^[%w%.%-]+%.%a%a+$' ) then
Anonymer Benutzer