Remove bogus @doc… elements from default $wgPageImagesScores setting

Such @doc… keys are not allowed at this level. They make it to the code
and cause confusion there. I added a test case for an edge case where this
really causes wrong results.

Bug: T212013
Change-Id: Ib391e5639ef5a34f9ee44f8c19b99e1dd19207bc
This commit is contained in:
Thiemo Kreuz 2019-01-09 12:38:59 +01:00
parent b058df99b8
commit baabc300ba
2 changed files with 3 additions and 2 deletions

View file

@ -38,6 +38,7 @@
}, },
"config": { "config": {
"PageImagesScores": { "PageImagesScores": {
"@doc": "Images <120px are usually from maintenace or stub templates; >600px are panoramas, less suitable.",
"value": { "value": {
"position": [ "position": [
8, 8,
@ -46,10 +47,8 @@
3 3
], ],
"width": { "width": {
"@doc119": "Very small images are usually from maintenace or stub templates",
"119": -100, "119": -100,
"400": 10, "400": 10,
"@doc600@": "Larger images are panoramas, less suitable",
"600": 5, "600": 5,
"601": 0 "601": 0
}, },

View file

@ -322,6 +322,8 @@ class LinksUpdateHookHandlerTest extends MediaWikiTestCase {
[ 'ratio', 30, 0 ], [ 'ratio', 30, 0 ],
[ 'ratio', 31, -100 ], [ 'ratio', 31, -100 ],
[ 'ratio', 40, -100 ], [ 'ratio', 40, -100 ],
'T212013' => [ 'width', 0, -100 ],
]; ];
} }