(bug 33602) list=allusers throws exceptions with invalid names
Some MediaWiki installations have invalid user names in user table
(most notable example: en.wikipedia). This commit DOES NOT resolve
the issue completely, it only makes the API behave more gracefully.
I have replaced User::newFromName call with User::newFromId, so the
User object should be always constructed. In case it was not, an
empty array will be provided instead of null when returning user
rights. I have removed keyToTitle calls for ContinueEnumParameter
as user names in the database are stored without underscores
(en.wikipedia has of course one user with _ in the database...).
This should fix invalidtitle error thrown.
There is one issue I don't know how to solve. When API outputs in
query-continue aufrom value with invalid user name, subsequent
call with aufrom set will return an error, because input parameters
'from' and 'to' are passed to keyToTitle method too. Should I
replace it with simple str_replace('_', ' ')?
Change-Id: I7d115e734cb8c93dcf6dc3b98bdbc81975951273