From 242cb48c881f5091530ae5b41c4a3111142d2c6a Mon Sep 17 00:00:00 2001 From: Casey Peel Date: Thu, 1 Jan 2026 15:46:44 -0800 Subject: [PATCH] French projects bypass the daily page limit --- phpstan.neon | 2 -- pinc/daily_page_limit.inc | 12 +++++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index 6253ddc11..38b21e45d 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -33,8 +33,6 @@ parameters: path: pinc/DifferenceEngineWrapper.inc - message: '#Call to function is_array\(\) with array will always evaluate to true.#' path: pinc/3rdparty/mediawiki/WordLevelDiff.php - - message: '#Function get_dpl_enforcement_for_user\(\) never returns null.*#' - path: pinc/daily_page_limit.inc - message: '#invoked with \d+ parameter(s?), \d+((-\d+)?) required#' - message: '#Variable .* might not be defined#' diff --git a/pinc/daily_page_limit.inc b/pinc/daily_page_limit.inc index 04b011e62..0f67c3175 100644 --- a/pinc/daily_page_limit.inc +++ b/pinc/daily_page_limit.inc @@ -49,9 +49,15 @@ function get_dpl_count_for_user_in_round(string $username, Round $round): int */ function get_dpl_enforcement_for_user(string $username, Round $round, Project $project): ?int { - // This function is a placeholder for sites to add any per-project - // customizations that might bypass the DPL enforcement. So while it - // doesn't currently return null, it might after site-specific updates. + // pgdp-production - projects with some primary languages bypass DPL + $dpl_exempt_languages = [ + "French", + "French, Middle (ca.1400-1600)", + "French, Old (842-ca.1400)", + ]; + if (in_array($project->languages[0], $dpl_exempt_languages)) { + return null; + } return get_dpl_count_for_user_in_round($username, $round); }