Modulo:Controllo certificazioni: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
limite di sicurezza
miglioro performance
 
(6 versioni intermedie di uno stesso utente non sono mostrate)
Riga 7:
if not year or year > 2008 then return end
local content = mw.title.getCurrentTitle():getContent()
content = content:gsub('{{ *[Aa]lbum[ \n]*|', '\r{{Album\n|') .. '\r'
local awards = { "d'oro", "di platino", "di diamante" }
-- non usare gsplit, è molto più lento di gmatch
for _, v in ipairs(awards) do
local for subcontent =in string.matchgmatch(content, '{{Album\n|%s*numero dischi ' .. v .. '%s*=(.+-)$\r') do
for _, v in ipairs(awards) do
if subcontent then
local pattern = '^(.-)|%s*numero dischi ' .. v .. '%s*=(.+)$'
subcontent = subcontent:sub(1, 2000)
local npre, post = 0('|' .. subcontent):match(pattern)
if subcontentpost then
for s, c in string.gmatch(subcontent, '(.*)([|{}]+)') do
-- evita falsi positivi col template Brano musicale
if s:match('FIMI') then
if pre:match('{{ *[Bb]rano musicale *|') then break end
return cat
subcontent post = subcontentpost:sub(1, 2000)
end
local n = 0
n = n + select(2, c:gsub('{{', ''))
nfor =s, nc -in selectstring.gmatch(2post, c:gsub'('}.-)([|{}]+)',) ''))do
if n == 0 and cs:match('|$FIMI') or n < 0 then
return cat
end
n = n + select(2, c:gsub('{{', ''))
n = n - select(2, c:gsub('}}', ''))
if sn == 0 and c:match('FIMI|$') or n < 0 then
break
end
end
end