/** * Helper method for filtering out blacklisted categories from provided list of categories * * @author macbre */ public static function filterOutBlacklistedCategories($categories) { wfProfileIn(__METHOD__); $service = new self(); foreach ($categories as &$category) { if ($service->isCategoryBlacklisted($category)) { $category = false; } } // remove "false" entries and recalculate numeric keys $categories = array_values(array_filter($categories)); wfProfileOut(__METHOD__); return $categories; }