There is a new service called ipstack, but their free option does
not support https, so by default there will not be any geoip service.
Bug: T199106
Change-Id: I9f4e59d736b50760f50c6214e2d191e72406d0d9
'mw' are '$' are globals, always have been, and aren't going
anywhere. They're every bit as real as their longer versions.
If anything, the longer ones are less "real" or 'stable" because
they're not used internally by RL and easier to accidentally
replace or override. For anecdotes and history, see 91f950d6b0.
Change-Id: I526fb8c961d9477992d88f2780a0ff4cbdc51923
It is created, unconditionally fired only once (right after creation),
and then used only with add(), which becomes a synchronous
self-call.
I've searched in Wikimedia Git and Codesearch, and found no uses
of `logEventQueue` or `mw.uls.eventlogger` outside this file.
Change-Id: I3832bcb409fc919c2078e583d50e20413dede163
Use of all: '.' in Gruntfile.js for eslint config and
eslintIgnore in package.json to ignore linting the "vendor/"
etc directory.
Bug: T203648
Change-Id: I65756ab3b6f413021cedeb22c7933c6cffa2cb78
$wgULSAnonCanChangeLanguage is documented as just affecting setting of
language for anonymous users via cookies and &setlang=. But currently it also
affects the fallback to Accept-Language if $wgULSLanguageDetection is enabled.
With this, $wgULSAnonCanChangeLanguage will now only control whether cookies
and &setlang= can be used for anonymous users, and keeps
$wgULSLanguageDetection independent.
Bug: T203179
Change-Id: I6c664ad11dc18b66190dc0644352b91adf87c9e5
If we use the Accept-Language header to determine the interface language,
we need to vary caching on it so that a user with a different Accept-Language
header won't get the wrong language out of the cache.
Note that for optimal cache hitrates, you might want to implement parsing of
the header in your cache itself.
Bug: T203179
Change-Id: I976696cf20a5da5b2767c87e0d754a901b711a46
368fe37a1a is broken when used on MediaWiki 1.31 and earlier because
it tries to add
$modules['ext.uls.displaysettings']['dependencies'][]
although $modules['ext.uls.displaysettings'] does not exist.
The whole module definition must moved from extension.json to
UniversalLanguageSelector.hooks.php.
Change-Id: Ie8f7f084c965e6dee33fef03448004d5d8805f2c
In core, modules 'mediawiki.api.*' got merged into 'mediawiki.api'
and deprecated in I0afdc8ab50bc1354bb5099bf39923c07eab0b665 included
in MediaWiki 1.32.
This change does not increase the version requirement in extension.json
to "MediaWiki": ">= 1.32.0" because it adds the removed dependencies
for earlier versions of MediaWiki in a hook.
Bug: T196802
Bug: T200168
Change-Id: I27dd62fae7a470549dd533f16c145cb023b16181
Notable changes:
* First query global preferences to detect if global language setting
is in use. If there is no global language setting, or if GlobalPreferences
extension is not installed, it will fall back to changing the language
as usual. If global language setting is found, it will add an override
instead.
* If a local override is added, the undo tooltip is different and links to
the global preferences page. The task design shows mw.notify style popup
located on a bottom right corner (LTR). I deviate from the design and
re-use the old undo tooltip with a different message instead, for
consistency. The message is chosen depending on whether local storage
value `uls-gp` is set to '1' (set in mw.uls.changeLanguage).
* I removed one use of deprecated mediawiki.api.options module. One other
use still remains.
* I changed tooltip text generation from html acrobatics to use
mw.message.parseDom. Because of that I also had to move the click handler
to avoid buildup of click handlers.
* In message documentation fixed acronym -> autonym.
Bug: T198206
Change-Id: Ie2ed792e222be919522bd1cdea98042515a0619d
* In mw.uls.addPreviousLanguage, jQuery.map was used for what is
essentially filtering, not mapping. Filtering was used to remove
one element from array. Use Array.prototype.splice instead.
* In mw.uls.getFrequentLanguageList, replace:
- jQuery.each with Array.prototype.forEach
- jQuery.inArray with Array.prototype.indexOf
- jQuery.grep with Array.prototype.filter
Change-Id: Id2208b3c89e982f91f49981d18e588ae8ce3b130
That second class (which is generated by the LanguageNameIndexer script)
is an integral part of the class under test.
Change-Id: I7d8dc66b4d1e86684e0de3e585d9e0a544640159
The plugin checks and flags potential security issues (XSS, SQLi, etc.)
using static analysis.
See <https://www.mediawiki.org/wiki/Phan-taint-check-plugin> for more
details.
Bug: T201219
Change-Id: Ib603ba19787c7f08e4d088ed6698eca87b60532b