Module:Citation/CS1/Identifiers: திருத்தங்களுக்கு இடையிலான வேறுபாடு
உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
சி en:Module:Citation/CS1/Identifiers இலிருந்து திருத்தங்கள் இறக்குமதி செய்யப்பட்டன |
sync from sandbox; |
||
வரிசை 21:
local url_string = options.id;
local ext_link;
local this_wiki_code = cfg.this_wiki_code;
local wd_article; -- article title from wikidata
வரிசை 33:
end
if string.match (mw.site.server, 'wikidata') then
வரிசை 417:
prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode, access=access}) .. (inactive or '')
-- id: match ('^10.5555') then -- test doi will never resolve
-- cat = ' ' .. set_error ('bad_doi');
-- end
local registrant = id:match ('^10%.([^/]+)/[^%s–]-[^%.,]$'); -- registrant set when doi has the proper basic form
registrant_err_patterns = { -- these patterns are for code ranges that are not supported
'^[^1-3]%d%d%d%d%.%d%d*$', -- 5 digits with subcode (0xxxx, 40000+); accecpts: 10000–39999
'^[^1-3]%d%d%d%d$', -- 5 digits without subcode (0xxxx, 40000+); accecpts: 10000–39999
'^[^1-9]%d%d%d%.%d%d*$', -- 4 digits with subcode (0xxx); accecpts: 1000–9999
'^[^1-9]%d%d%d$', -- 4 digits without subcode (0xxx); accecpts: 1000–9999
'^%d%d%d%d%d%d+', -- 6 or more digits
'^%d%d?%d?%.%d%d*$', -- less than 4 digits with subcode
'^%d%d?%d?$', -- less than 4 digits without subcode
'^5555$', -- test registrant will never resolve
}
if registrant then -- when doi has proper form
for i, pattern in ipairs (registrant_err_patterns) do -- spin through error patterns
if registrant:match (pattern) then -- to validate registrant codes
cat = ' ' .. set_error ('bad_doi'); -- when found, mark this doi as bad
break; -- and done
end
end
else
cat = ' ' .. set_error ('bad_doi'); -- invalid directory or malformed
end
வரி 484 ⟶ 508:
if isbn_str:match( "^97[89]%d*$" ) == nil then
return false, 'invalid prefix'; -- fail when isbn13 does not begin with 978 or 979
end
if isbn_str:match ('^9790') then
return false, 'invalid group id'; -- group identifier '0' is reserved to ismn
end
return is_valid_isxn_13 (isbn_str), 'checksum';
வரி 1,122 ⟶ 1,149:
function as they are directly rendered as free without using an additional parameter.
access-level values must match the case used in cfg.
]]
வரி 1,133 ⟶ 1,160:
local access_level = args[access_param]; -- get the assigned value if there is one
if is_set (access_level) then
if not in_array (access_level, cfg.
table.insert( z.message_tail, { set_error( 'invalid_param_val', {access_param, access_level}, true ) } );
access_level = nil; -- invalid so unset
வரி 1,140 ⟶ 1,167:
table.insert( z.message_tail, { set_error( 'param_access_requires_param', {k:lower()}, true ) } ); -- param name is uppercase in cfg.id_handlers (k); lowercase for error message
end
id_accesses_list[k] = cfg.keywords_xlate[access_level]; -- get translated keyword
end
end
| |||