Modul:UrlCheck: Unterschied zwischen den Versionen

K
30 Versionen von wikivoyage:Modul:UrlCheck importiert
KKeine Bearbeitungszusammenfassung
K (30 Versionen von wikivoyage:Modul:UrlCheck importiert)
 
(7 dazwischenliegende Versionen von 3 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
-- documentation
-- module variable and administration
local UrlCheck = {
local uc = {
suite  = 'vCard',
moduleInterface = {
serial = '2020-10-23',
suite  = 'UrlCheck',
item  = 40849609
serial = '2023-01-17',
item  = 40849609
}
}
}
-- module import
local ui = mw.loadData( 'Module:UrlCheck/i18n')
-- module variable
local uc = {}


function uc.ip4( address )
function uc.ip4( address )
Zeile 148: Zeile 144:
if uc.ip4( host ) 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
-- Thai diacritical marks ะ (0E30) - ๏ (0E4F)
return 22
return 22
elseif not host:match( '^[%w%.%-]+%.%a%a+$' ) then
elseif not host:match( '^[%w%.%-]+%.%a%a+$' ) then
Zeile 175: Zeile 172:
local result = uc.isUrl( args.url, false )
local result = uc.isUrl( args.url, false )
if args.show:lower() == 'msg' then
if args.show:lower() == 'msg' then
local ui = mw.loadData( 'Module:UrlCheck/i18n')
if ui[ result ] then
if ui[ result ] then
return ui[ result ]
return ui[ result ]