Fix multiple bugs and improve robustness

- Fix date format in report(): H:m:s -> H:i:s (m=month, i=minutes)
- Fix loadWhitelists(): skip lines shorter than 32 chars to avoid empty hash entries
- Fix updateCombinedWhitelist(): return false on hash mismatch after download
- Fix scan(): handle file_get_contents() failure for unreadable files
- Fix scanFunc_RE(): suppress and handle invalid regex patterns gracefully
- Fix addWordpressChecksums(): validate version format, handle network/JSON errors, support both API response formats
- Add 30s HTTP timeout to updateCombinedWhitelist() network requests
- Fix composer.json minimum PHP version: 5.2 -> 5.3 (anonymous functions require 5.3)
- Add .gitignore for .idea/, whitelist.dat, vendor/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Thomas Schmidt
2026-06-01 16:12:36 +02:00
parent 201ab77516
commit 31fa36c82a
3 changed files with 46 additions and 12 deletions

View File

@@ -6,7 +6,7 @@
"license": "GPL-3.0",
"homepage": "https://github.com/scr34m/php-malware-scanner",
"require": {
"php": ">=5.2.0"
"php": ">=5.3.0"
},
"autoload": {
},