SpecialNewpages: add $attribs['class'] immediately before creating <li>
authorZhuyifei1999 <zhuyifei1999@gmail.com>
Fri, 18 Aug 2017 08:01:02 +0000 (08:01 +0000)
committerZhuyifei1999 <zhuyifei1999@gmail.com>
Fri, 18 Aug 2017 08:01:02 +0000 (08:01 +0000)
commit42ba9ea516beb06969bd3e579aa506821629ecb8
tree4b56d42554f9f5522761d1fde88a0dfffffca77b
parenta5d7d024ba81eef23a8ca40ffe430442cd86d2e9
SpecialNewpages: add $attribs['class'] immediately before creating <li>

The call to `wfArrayFilterByKey` / `isReservedDataAttribute` removes
all attributes that are not reserved (`/^data-(ooui|mw|parsoid)/i`).
The `class` attribute is not reserved, and is therefore unfortunately
removed. Moving the addition of $attribs['class'] will allow overriding
of the sanitizer, and actually add the attribute.

It is also moved below the Hooks::run call so that extensions can
effectively add the classes, and SpecialNewpages will not disregard
the changes to `$classes` from hooks.

This behaviour / placement is consistent with other calls to
`wfArrayFilterByKey` / `isReservedDataAttribute`, such as
`OldChangesList`, `DeletedContribsPager`, and `ContribsPager`.

Bug: T173556
Change-Id: I40e5e98228dae79a2de39efc28091cc9f69f64ea
includes/specials/SpecialNewpages.php