mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CookieWarning
synced 2024-11-23 22:03:41 +00:00
Bump MW version, remove deprecated IP class, update .gitignore
Bug: T247155 Change-Id: Idef39fd39dd8a9f3483ea30e4a01422923c16e05
This commit is contained in:
parent
fe0e56c5c0
commit
95f25aa2ed
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,3 +2,4 @@ vendor
|
||||||
composer.lock
|
composer.lock
|
||||||
node_modules
|
node_modules
|
||||||
/.eslintcache
|
/.eslintcache
|
||||||
|
.DS_Store
|
||||||
|
|
|
@ -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": [
|
||||||
|
|
|
@ -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 ) !== '/' ) {
|
||||||
|
|
Loading…
Reference in a new issue