Issue summary
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-zA_Z0-9).
The key obtained from Maxmind was 40 characters long and included the underscore (_) character so the check failed.
Changing that line to:
if (preg_match('/^([0-9A-Za-z]{12}|[0-9A-Za-z]{16}|[0-9A-Za-z_]{40})$/', $input)) {
allows it to work.
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-zA_Z0-9).
The key obtained from Maxmind was 40 characters long and included the underscore (_) character so the check failed.
Changing that line to:
if (preg_match('/^([0-9A-Za-z]{12}|[0-9A-Za-z]{16}|[0-9A-Za-z_]{40})$/', $input)) {
allows it to work.