Why:
* The 'logout' API allows users to logout of their account
* This calls the "UserLogoutComplete" hook which users assume
is only called when a logout is successful.
* However, the hook is called by the API even if the user making
the request was not logged in
* The Special:UserLogout page does not call the hook if the user
performing the request is already logged out.
What:
* Return early in ApiLogout::execute if the user is not logged
in, and also add a warning to the response to indicate this.
Bug: T374353
Change-Id: I72e73c2391a475cec2e5cb24250f9aa2b792e5de
...because I don't want to end up thinking, "oh, this is unused, I should remove it" just to find out that the style was, in fact, used, despite not showing up on codesearch.
Change-Id: Ib73750be8814e24c07b4b116303a1eac34d163b4
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.
Once the sniff is enabled it avoids that new code is missing type
declarations. This is focused on documentation and does not change code.
Change-Id: I2606072015d71b4bdda70a7c149d9f55ac205a3c
* footerHtml() contained seemingly unused logic for extracting
the host name for use in the "search-interwiki-resultset-link"
message.
This was added during in change I9498a070da (T307468, 0d1184e501).
It seems to be a left-over from the "search-interwiki-default"
message that Special:Search used previously.
Overrides for specific wikis are now in the heading based on the
the "search-interwiki-custom" message, which feeds customCaptions
which takes precedence over the entire message, instead of requiring
wikis to e.g. switch/if-case inside wikitext based on "$1" or something.
The qqq.json entry for "search-interwiki-resultset-link" mentions
no parameters, and none of the translations use it either. I've
also checked WikimediaMessages extension, en.wikipedia.org, Commons,
and Wikidata in case they use the parameter there, but found nothing.
* headerHtml() used wfExpandUrl() combined with wfParseUrl().
This is problematic for Phan analysis since both can fail and
technically require a fallback. This is currently tolerated by Phan
because it doesn't yet understand that `false[key]` yields the
same kind of warning PHP as `null[key]`.
https://github.com/phan/phan/issues/4879
It seems this code has evolved over the years into what it is
now, and it's not clear that this is all intentional or by design.
In 2011, r95011 (92ff782a9) changed this code from parse_url to
wfParseUrl to handle protocol-relative URLs, which has long been
fixed in PHP: https://3v4l.org/sSkfX.
In 2017, If78cb0c29a (6e155624fa) changed further switched from
Title->getUrl() to Interwiki->getURL() with wfExpandUrl() to handle
same-site destinations, e.g. when an interwiki is on the same
domain, and defined on Special:Interwiki without any hostname.
The code had a note saying:
"hostname of the other wiki which might suck if there are many wikis
on one hostname" which appears to remain true today.
I've changed this all back to parse_url(), with an explicit fallback
to $iwPrefix for invalid urls or same-site interwikis. If we
want to display the current domain name there instead, we can do
that explicitly by falling back go $wgServerName instead.
* Fix potential escaping problem by pasing $caption to element()
instead of rawElement() since in headerHtml() at least one of the
values in the assignment chain caption is plain text, not escaped
HTML. Move escaping down to the last mile by storing plain text
instead.
Idem for footerHtml(), although that one is safe and simple as-is,
I've switched it similarly to plain text and let Html::element do
the escaping.
Change-Id: I3281e12ee52af168f85cdb12ac4d53fc25c9f38d
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.
Once the sniff is enabled it avoids that new code is missing type
declarations. This is focused on documentation and does not change code.
Change-Id: I90ecf85cb6f639af4be1947ccfbfb16d5b84cab3
Depending on configuration, this returns either the interface language
code of the current user or the current page language.
Bug: T4085
Change-Id: Iab7fda272ec81af88c74612727ff6bed014d4a81
Added with wrong name in 9fb510f31d (r83218)
The correct named mMaxUploadSize was added in 29e672787c (r109554)
Change-Id: Ib0402017e602ad3e79b7ffbb5b02bcedae1fab6b