Μετάβαση στο περιεχόμενο

Module:Category handler/shared

Από τη Βικιπαίδεια, την ελεύθερη εγκυκλοπαίδεια
Αυτή είναι μια παλιά έκδοση της σελίδας, όπως διαμορφώθηκε από τον Mr. Stradivarius (συζήτηση | συνεισφορές) στις 01:51, 7 Ιουλίου 2014 (allow specifying a custom blacklist). Η τρέχουσα διεύθυνση (URL) είναι μόνιμος σύνδεσμος προς αυτή την έκδοση, που μπορεί να διαφέρει σημαντικά από την τρέχουσα έκδοση.
-- This module contains shared functions used by [[Module:Category handler]]
-- and its submodules.

local function matchesBlacklist(page, blacklist)
    if type(page) ~= 'string' then
    	return nil
    end
    for i, pattern in ipairs(blacklist) do
        local match = mw.ustring.match(page, pattern)
        if match then
            return match
        end
    end
end

return {
	matchesBlacklist = matchesBlacklist
}