Skip to content

Commit f0f434b

Browse files
cpeelsrjfoo
authored andcommitted
French projects bypass the daily page limit
1 parent 2a80d62 commit f0f434b

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

phpstan.neon

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ parameters:
3333
path: pinc/DifferenceEngineWrapper.inc
3434
- message: '#Call to function is_array\(\) with array<string> will always evaluate to true.#'
3535
path: pinc/3rdparty/mediawiki/WordLevelDiff.php
36-
- message: '#Function get_dpl_enforcement_for_user\(\) never returns null.*#'
37-
path: pinc/daily_page_limit.inc
3836

3937
- message: '#invoked with \d+ parameter(s?), \d+((-\d+)?) required#'
4038
- message: '#Variable .* might not be defined#'

pinc/daily_page_limit.inc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,15 @@ function get_dpl_count_for_user_in_round(string $username, Round $round): int
4949
*/
5050
function get_dpl_enforcement_for_user(string $username, Round $round, Project $project): ?int
5151
{
52-
// This function is a placeholder for sites to add any per-project
53-
// customizations that might bypass the DPL enforcement. So while it
54-
// doesn't currently return null, it might after site-specific updates.
52+
// pgdp-production - projects with some primary languages bypass DPL
53+
$dpl_exempt_languages = [
54+
"French",
55+
"French, Middle (ca.1400-1600)",
56+
"French, Old (842-ca.1400)",
57+
];
58+
if (in_array($project->languages[0], $dpl_exempt_languages)) {
59+
return null;
60+
}
5561

5662
return get_dpl_count_for_user_in_round($username, $round);
5763
}

0 commit comments

Comments
 (0)