From 1857627c2ffcd6615c8e85546a5f94f7a00dda48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Laxstr=C3=B6m?= Date: Fri, 7 Sep 2018 09:10:43 +0200 Subject: [PATCH] Drop support for discontinued freegeoip.net 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 --- UniversalLanguageSelector.hooks.php | 7 ++----- extension.json | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/UniversalLanguageSelector.hooks.php b/UniversalLanguageSelector.hooks.php index feb07f79..d0fd1d73 100644 --- a/UniversalLanguageSelector.hooks.php +++ b/UniversalLanguageSelector.hooks.php @@ -125,7 +125,7 @@ class UniversalLanguageSelectorHooks { $out->addModules( 'ext.uls.compactlinks' ); } - if ( $wgULSGeoService ) { + if ( is_string( $wgULSGeoService ) ) { $out->addModules( 'ext.uls.geoclient' ); } @@ -309,10 +309,7 @@ class UniversalLanguageSelectorHooks { // Place constant stuff here (not depending on request context) - if ( $wgULSGeoService === true ) { - $wgULSGeoService = 'https://freegeoip.net/json/?callback=?'; - } - if ( $wgULSGeoService ) { + if ( is_string( $wgULSGeoService ) ) { $vars['wgULSGeoService'] = $wgULSGeoService; } diff --git a/extension.json b/extension.json index 2b48ade3..5902a78f 100644 --- a/extension.json +++ b/extension.json @@ -59,8 +59,8 @@ "compact-language-links": true }, "config": { - "@ULSGeoService": "ULS can use a geolocation service to suggest languages based on the country the user is vising from. If set to true, it will query a free geoip service. Setting this to false will prevent built-in geolocation from being used. You can provide your own geolocation by setting window.Geo to an object which has key \"country_code\" or \"country\".", - "ULSGeoService": true, + "@ULSGeoService": "ULS can use a geolocation service to suggest languages based on the country the user is vising from. If set to an URL it will query that service which must return an object which has key \"country_code\" or \"country\". For example https://api.ipstack.com/check?access_key=yourkey&fields=country_code. Setting this to false will prevent built-in geolocation from being used. You can also provide your own geolocation by assigning such object to window.Geo.", + "ULSGeoService": false, "@ULSEnable": "Enable language selection, compact language links, input methods and webfonts for everyone, unless the behavior is overridden by the configuration variables below. Even if false the classes and resource loader modules are registered for the use of other extensions. Language changing via cookie or setlang query parameter is not possible.", "ULSEnable": true, "@ULSEnableAnon": "Equivalent to $wgULSEnable for anonymous users only. Does not have any effect if $wgULSEnable is false.",