Allow passing detailed permission errors data to API
authorBartosz Dziewoński <matma.rex@gmail.com>
Mon, 19 Oct 2015 12:30:40 +0000 (14:30 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Mon, 2 Nov 2015 16:11:50 +0000 (17:11 +0100)
commit92c29b8891c15c9e7f0cd5e821a819027898b68d
treeb14ea16835847c326de13d4a4218663bf294d14f
parentd2d935483fd57798aedce43629229aab887c5b2a
Allow passing detailed permission errors data to API

Using the new system introduced in
1c57794e371d74e1d88748de567a1c3358c3ad2e (see T47843).

This change allows Title::getUserPermissionsErrors() to include
MessageSpecifiers instead of string message keys in its return value.
This doesn't seem to have any bad effects, and should work seamlessly as
long as callers aren't trying to do anything stupid and just pass the
value to PermissionsError or OutputPage::showPermissionsErrorPage()
or wfMessage() or some such.

If the callers *are* trying something stupid, nothing worse than
duplicated or otherwise less-than-perfect error messages (in code
which tries to handle some message keys specially) should happen.
(I fixed wfMergeErrorArrays(), but who knows what else lurks in all
this code.) Any problems should only affect new-style errors using
MessageSpecifier, though.

Since MessageSpecifiers tend to be stringable, we probably won't get
fatals, but might get incorrect checks. Should we try to log this
happening somehow?

Goes with I42a0c5b0ea7e61088dd609b764dd7d1396c60cd5 in TitleBlacklist.

Bug: T115258
Change-Id: I1334ba21a2862973a9d8ff5be2c9bec06a82698b
RELEASE-NOTES-1.27
docs/hooks.txt
includes/GlobalFunctions.php
includes/Title.php
includes/api/ApiBase.php
includes/api/ApiUpload.php