mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CookieWarning
synced 2024-11-23 13:56:53 +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
|
||||
node_modules
|
||||
/.eslintcache
|
||||
.DS_Store
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
"type": "other",
|
||||
"license-name": "MIT",
|
||||
"requires": {
|
||||
"MediaWiki": ">= 1.32.0"
|
||||
"MediaWiki": ">= 1.35.0"
|
||||
},
|
||||
"MessagesDirs": {
|
||||
"CookieWarning": [
|
||||
|
|
|
@ -4,7 +4,7 @@ namespace CookieWarning;
|
|||
|
||||
use Http;
|
||||
use InvalidArgumentException;
|
||||
use IP;
|
||||
use Wikimedia\IPUtils;
|
||||
|
||||
/**
|
||||
* 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] ) ) {
|
||||
return $this->locatedIPs[$ip];
|
||||
}
|
||||
if ( !IP::isValid( $ip ) ) {
|
||||
if ( !IPUtils::isValid( $ip ) ) {
|
||||
throw new InvalidArgumentException( "$ip is not a valid IP address." );
|
||||
}
|
||||
if ( substr( $this->geoIPServiceURL, -1 ) !== '/' ) {
|
||||
|
|
Loading…
Reference in a new issue