Bump MW version, remove deprecated IP class, update .gitignore

Bug: T247155
Change-Id: Idef39fd39dd8a9f3483ea30e4a01422923c16e05
This commit is contained in:
ankit 2020-03-14 14:31:36 +05:30
parent fe0e56c5c0
commit 95f25aa2ed
3 changed files with 4 additions and 3 deletions

1
.gitignore vendored
View file

@ -2,3 +2,4 @@ vendor
composer.lock composer.lock
node_modules node_modules
/.eslintcache /.eslintcache
.DS_Store

View file

@ -11,7 +11,7 @@
"type": "other", "type": "other",
"license-name": "MIT", "license-name": "MIT",
"requires": { "requires": {
"MediaWiki": ">= 1.32.0" "MediaWiki": ">= 1.35.0"
}, },
"MessagesDirs": { "MessagesDirs": {
"CookieWarning": [ "CookieWarning": [

View file

@ -4,7 +4,7 @@ namespace CookieWarning;
use Http; use Http;
use InvalidArgumentException; use InvalidArgumentException;
use IP; use Wikimedia\IPUtils;
/** /**
* Implements the GeoLocation class, which allows to locate the user based on the IP address. * Implements the GeoLocation class, which allows to locate the user based on the IP address.
@ -32,7 +32,7 @@ class HttpGeoLocation implements GeoLocation {
if ( isset( $this->locatedIPs[$ip] ) ) { if ( isset( $this->locatedIPs[$ip] ) ) {
return $this->locatedIPs[$ip]; return $this->locatedIPs[$ip];
} }
if ( !IP::isValid( $ip ) ) { if ( !IPUtils::isValid( $ip ) ) {
throw new InvalidArgumentException( "$ip is not a valid IP address." ); throw new InvalidArgumentException( "$ip is not a valid IP address." );
} }
if ( substr( $this->geoIPServiceURL, -1 ) !== '/' ) { if ( substr( $this->geoIPServiceURL, -1 ) !== '/' ) {