ozh / yourls-geoip-update

🌍 YOURLS plugin to update the GeoIP database
7 stars 2 forks source link

Currently, working? Invalid license key #4

Closed blankster closed 10 months ago

blankster commented 1 year ago

Thanks for the plugin in general 👍

I'm getting currently:

Database not updated.

Error downloading "GeoLite2-Country". Invalid license key.

I've tried https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&license_key=YOUR_LICENSE_KEY&suffix=tar.gz to be sure, that my key is working, and I could download with the same key (and validated it multiple times) without problems.

If it should work, how can I further debug this problem? Is it possible that the plugin is currently broken with the latest YOURLs 1.9.2?

What I've noticed is that my license key looks drastically longer (40 characters long) than the one on the screenshot in the README.md. Is it possible that something regarding the key format has changed?

fezzzza commented 1 year ago

It looks like the licence key format has changed to include underscores, and the underscores are currently being sanitised from the input. The fix is to update line 103 of plugin.php with:

return preg_replace('/[^a-zA-Z0-9_]/', '', $key);

Now it works fine for me.

fribse commented 1 year ago

That made it work for me, thankyou!

ozh commented 10 months ago

Fixed via #5