Модуль:Песочница/Pok: различия между версиями
Pok (обсуждение | вклад) Нет описания правки |
Pok (обсуждение | вклад) Нет описания правки |
||
| Строка 33: | Строка 33: | ||
return "" | return "" | ||
end | end | ||
local MAX_CHECKS = 100 | |||
local checkCount = 0 | |||
local function fileExists(name) | local function fileExists(name) | ||
if checkCount >= MAX_CHECKS then | |||
return false | |||
end | |||
checkCount = checkCount + 1 | |||
local title = mw.title.new(name, "File") | local title = mw.title.new(name, "File") | ||
return title and title.exists | return title and title.exists | ||