Catrope has uploaded a new change for review.
Change subject: (bug 31849) API imageinfo correctly handle redirects
......................................................................
(bug 31849) API imageinfo correctly handle redirects
RepoGroup::singleton()->findFiles() returns an associative array mapping
the redirect *target* to the image object; the image object refers back
to the original title queried.
If a redirect and its target are both queried,
RepoGroup::singleton()->findFiles() will return an entry for the target
title only, mapping to an image object that may have getOriginalTitle()
returning the redirect. If this happens, prop=imageinfo will never see
an entry for which getOriginalTitle()->isRedirect() is false and so will
not return any information about the image.
The fix is to ignore getOriginalTitle() entirely. Instead, we just go
through each of our queried titles and see if we got any result back.
Note this automatically handles a "redirects=1" query correctly, since
in that case any local redirect will already have been followed before
we ever got the list of titles to query.
Conflicts:
RELEASE-NOTES-1.21
Change-Id: I0b2982901e2dc4491e2933291fd97697b2a622a9
---
M RELEASE-NOTES-1.21
M includes/api/ApiQueryImageInfo.php
2 files changed, 10 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/78/45178/1
--
To view, visit https://gerrit.wikimedia.org/r/45178
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0b2982901e2dc4491e2933291fd97697b2a622a9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.21wmf8
Gerrit-Owner: Catrope <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits