New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow using paid db-ip urls for auto update #15606
Conversation
plugins/GeoIp2/GeoIP2AutoUpdater.php
Outdated
@@ -741,4 +744,28 @@ public static function isDbIpUrl($url) | |||
{ | |||
return !! preg_match('/db-ip\.com/', $url); | |||
} | |||
|
|||
private function isPaidDbIpUrl($url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to add a test for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some tests
|
||
protected function fetchUrl($url) | ||
{ | ||
return Http::fetchRemoteFile($url); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sgiehl just realising we should be checking whether internet is enabled and if not, throw an exception maybe?
BTW out of curiosity: Any reason using fetchRemoteFile
over sendHttpRequest
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking if internet is enabled is done in __construct
, so need to do that another time.
BTW out of curiosity: Any reason using fetchRemoteFile over sendHttpRequest?
No. Actually not. Feel free to change that...
* Allow using paid db-ip urls for auto update * apply review feedback * Adds some Unit tests for new GeoIP2AutoUpdater methods
* Allow using paid db-ip urls for auto update * apply review feedback * Adds some Unit tests for new GeoIP2AutoUpdater methods
This allows adding urls like
https://db-ip.com/account/$ACCOUNT_KEY/db/ip-to-location
orhttps://db-ip.com/account/$ACCOUNT_KEY/db/ip-to-location/mmdb/url
directly to the auto updaterfixes #15580