Page MenuHomePhabricator

Language::listToText() assumes the indexs in a list start at 0 and are consecutive.
Closed, ResolvedPublic


[[$3413 | Language::listToText() ]] uses for(;;) which assumes the index in a list starts at 0 and following keys are consecutive integers.

This assumption fails (and results in warnings with E_STRICT) when [[$270 | SpecialListGroupRights::formatPermissions() ]] uses the key-preserving array_intersect() to create a subset of $allGroups.

Solutions include using array_values() (again) in SpecialListGroupRights::formatPermissions() or to change Language::listToText() so that it uses array_values() or foreach()

(I prefer the latter.)

Related Objects

Event Timeline

Change 445653 had a related patch set uploaded (by MarkAHershberger; owner: MarkAHershberger):
[mediawiki/core@master] Fix some warnings

Change 445653 merged by jenkins-bot:
[mediawiki/core@master] Language::listToText: Avoid PHP warnings from E_STRICT