|
|
| Línea 261: |
Línea 261: |
| end | | end |
|
| |
|
| -- Format an external link with error checking
| |
| function externallink( URL, label, source )
| |
| local error_str = "";
| |
| if not is_set( label ) then
| |
| label = URL;
| |
| if is_set( source ) then
| |
| error_str = seterror( 'bare_url_missing_title', { wrap( 'parameter', source ) }, false, " " );
| |
| else
| |
| error( cfg.messages["bare_url_no_origin"] );
| |
| end
| |
| end
| |
| if not checkurl( URL ) then
| |
| error_str = seterror( 'bad_url', {}, false, " " ) .. error_str;
| |
| elseif mw.title.getCurrentTitle():inNamespaces(0, 100, 104) and
| |
| not mw.title.getCurrentTitle().text:match('Wikipedia') and
| |
| URL:match('//[%a%.%-]+%.wikipedia%.org') then
| |
| error_str = seterror( 'bad_url_autorreferencia', {}, false, " " ) .. error_str;
| |
| end
| |
| return table.concat({ "[", URL, " ", safeforurl( label ), "]", error_str });
| |
| end
| |
| --[[--------------------------< N O R M A L I Z E _ L C C N >-------------------------------------------------- | | --[[--------------------------< N O R M A L I Z E _ L C C N >-------------------------------------------------- |
|
| |
|