Изменения

Строка 554: Строка 554:  
local handler = options.handler;
 
local handler = options.handler;
 
local err_flag;
 
local err_flag;
 +
 +
local function is_extended_free (registrant, id) -- local function to check those few registrants that are mixed; identifiable by the doi suffix <incipit>
 +
if cfg.extended_registrants_t[registrant] then -- if this registrant has known free-to-read extentions
 +
for _, incipit in ipairs (cfg.extended_registrants_t[registrant]) do -- loop through the registrant's incipits
 +
if string.find (id, incipit, 1, true) then -- if found
 +
return true;
 +
end
 +
end
 +
end
 +
end
    
local text;
 
local text;
Строка 563: Строка 573:  
if 4 < inactive:len() then -- inactive date has more than just a year (could be anything)
 
if 4 < inactive:len() then -- inactive date has more than just a year (could be anything)
 
local lang_obj = mw.getContentLanguage(); -- get a language object for this wiki
 
local lang_obj = mw.getContentLanguage(); -- get a language object for this wiki
good, inactive_month = pcall (lang_obj.formatDate, lang_obj, 'F', inactive); -- try to get the month name from the inactive date
+
good, inactive_month = pcall (lang_obj.formatDate, lang_obj, 'xg', inactive); -- try to get the month name from the inactive date
 
if not good then
 
if not good then
 
inactive_month = nil; -- something went wrong so make sure this is unset
 
inactive_month = nil; -- something went wrong so make sure this is unset
Строка 612: Строка 622:  
options.coins_list_t['DOI'] = nil; -- when error, unset so not included in COinS
 
options.coins_list_t['DOI'] = nil; -- when error, unset so not included in COinS
 
else
 
else
if not access and cfg.known_free_doi_registrants_t[registrant] then -- |doi-access=free not set and <registrant> is known to be free
+
if not access and (cfg.known_free_doi_registrants_t[registrant] or is_extended_free (registrant, id)) then -- |doi-access=free not set and <registrant> is known to be free
 
set_message ('maint_doi_unflagged_free'); -- set a maint cat
 
set_message ('maint_doi_unflagged_free'); -- set a maint cat
 
end
 
end
Анонимный участник