Switch default ULS geoip provider

Current provider is going away. Switching to another free provider.
Implemented caching with a cookie for speed and to avoid generating
unnecessary load on the service.

Bug: T143542
Change-Id: I191d69a6fb8abe9556f475dfef1368dc9f96b846
This commit is contained in:
Niklas Laxström
2016-08-22 12:31:35 +02:00
committed by Amire80
parent f53806a965
commit 4cd1def0f3
3 changed files with 32 additions and 26 deletions

View File

@@ -121,10 +121,8 @@ class UniversalLanguageSelectorHooks {
$out->addModules( 'ext.uls.compactlinks' );
}
if ( is_string( $wgULSGeoService ) ) {
if ( $wgULSGeoService ) {
$out->addModules( 'ext.uls.geoclient' );
} elseif ( $wgULSGeoService === true ) {
$out->addScript( '<script src="//meta.wikimedia.org/geoiplookup"></script>' );
}
if ( self::isToolbarEnabled( $out->getUser() ) ) {
@@ -312,7 +310,11 @@ class UniversalLanguageSelectorHooks {
$wgWBClientSettings;
// Place constant stuff here (not depending on request context)
if ( is_string( $wgULSGeoService ) ) {
if ( $wgULSGeoService === true ) {
$wgULSGeoService = 'https://freegeoip.net/json/?callback=?';
}
if ( $wgULSGeoService ) {
$vars['wgULSGeoService'] = $wgULSGeoService;
}