The check on the Maxmind key is incorrect and results in being unable to download the GeoIP database.
Steps to reproduce
Get key from Maxmind
Enter into config file
Try to update database
Expected result
Database update should succeed
Actual result
Get error message about needing a key.
Installation
Version and method
MailWatch Version: stable 1.2.0
Server configuration
Operation System: Fedora 38
PHP version: 8.1.22
Database: mariadb 10.5.21
Mail Server: Sendmail
Used web server: Apache
The key check in functions.php at line 4628 uses a regex to check the key and only allows 12 or 16 characters (a-zAZ0-9).
The key obtained from Maxmind was 40 characters long and included the underscore () character so the check failed.
Changing that line to:
if (pregmatch('/^([0-9A-Za-z]{12}|[0-9A-Za-z]{16}|[0-9A-Za-z]{40})$/', $input)) {
Issue summary
The check on the Maxmind key is incorrect and results in being unable to download the GeoIP database.
Steps to reproduce
Expected result
Database update should succeed
Actual result
Get error message about needing a key.
Installation
Version and method
Server configuration
The key check in functions.php at line 4628 uses a regex to check the key and only allows 12 or 16 characters (a-zAZ0-9). The key obtained from Maxmind was 40 characters long and included the underscore () character so the check failed.
Changing that line to: if (pregmatch('/^([0-9A-Za-z]{12}|[0-9A-Za-z]{16}|[0-9A-Za-z]{40})$/', $input)) {
allows it to work.