https://bugzilla.wikimedia.org/show_bug.cgi?id=17832

           Summary: When blocked, action=delete returns "unknownerror"
                    instead of "permissiondenied"
           Product: MediaWiki
           Version: 1.15-svn
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: patch
          Severity: normal
          Priority: Normal
         Component: API
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


Created an attachment (id=5897)
 --> (https://bugzilla.wikimedia.org/attachment.cgi?id=5897)
Add a reset() in Title::getUserPermissionsErrors, so callers can use current()
to get the first error.

If a blocked user with the "delete" right tries to delete a page using the API
action=delete, the response is "unknownerror" rather than the expected
"permissiondenied". The problem is that the API code uses PHP's current() to
try to retrieve one error from the returned error array, but
$title->getUserPermissionsErrors() leaves the array's internal position in the
past-the-end state so current() returns false. FWIW, this seems to have been
broken in r36692.

While the API could be changed all over the place to use reset() instead of
current(), it seems easier to just add the reset in getUserPermissionsErrors();
the attached patch does just that.


-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to