|
|
| Zeile 1: |
Zeile 1: |
| | -- module import |
| | local ui = mw.loadData( 'Module:UrlCheck/i18n') |
| | |
| | -- module variable |
| local uc = {} | | local uc = {} |
|
| |
| uc.msg = {
| |
| unknown = 'Unknown error',
| |
| [ 0 ] = 'No error detected',
| |
| [ 1 ] = 'Host with non-ASCII characters',
| |
| [ 2 ] = 'Host is IP address',
| |
| [ 3 ] = 'URL is empty',
| |
| [ 4 ] = 'URL has more then 2048 characters',
| |
| [ 5 ] = 'URL contains control marks or spaces',
| |
| [ 6 ] = 'Missing or wrong protocol',
| |
| [ 7 ] = 'Host starts with slash / character',
| |
| [ 8 ] = 'Host contains invalid character combinations',
| |
| [ 9 ] = 'More than one commercial ats @ in host detected',
| |
| [ 10 ] = 'Commercial at @ detected but user or host are missing',
| |
| [ 11 ] = 'More than one colon : in user detected',
| |
| [ 12 ] = 'Colon : detected but user or password are missing',
| |
| [ 13 ] = 'User has more than 64 characters',
| |
| [ 14 ] = 'Host ist empty',
| |
| [ 15 ] = 'More than one colon : in host detected',
| |
| [ 16 ] = 'Colon : detected but host or port are missing',
| |
| [ 17 ] = 'Port out of range of 0 … 65535',
| |
| [ 18 ] = 'Host has more than 253 characters',
| |
| [ 19 ] = 'Host with missing dot as domain separator',
| |
| [ 20 ] = 'Host has dot but no top-level domain',
| |
| [ 21 ] = 'Unknown top-level domain',
| |
| [ 22 ] = 'Invalid host structure',
| |
| }
| |
|
| |
|
| function uc.ip4( address ) | | function uc.ip4( address ) |
| Zeile 171: |
Zeile 148: |
| local result = uc.isUrl( args.url ) | | local result = uc.isUrl( args.url ) |
| if args.show:lower() == 'msg' then | | if args.show:lower() == 'msg' then |
| if uc.msg[ result ] then | | if ui[ result ] then |
| return uc.msg[ result ] | | return ui[ result ] |
| else | | else |
| return uc.msg.unknown | | return ui.unknown |
| end | | end |
| end | | end |