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 | return false | ||
end | end | ||
end | end | ||
return | return true -- ok | ||
end | end | ||
return | return false | ||
end | end | ||
| Zeile 153: | Zeile 153: | ||
-- future: check of top-level domain | -- future: check of top-level domain | ||
if uc.ip4( host ) | 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 | ||