diff options
author | Andy Xheli <andyxheli@gmail.com> | 2021-04-14 17:49:23 +0300 |
---|---|---|
committer | Andy Xheli <andyxheli@gmail.com> | 2021-04-14 17:58:29 +0300 |
commit | 3da5da42e0392869272d1a50462bdadf1aa92f98 (patch) | |
tree | 33cc3222959745b32f767198bd181eaf742d1439 | |
parent | a154822cdf873dbc337b1580b592f6c7eda2147d (diff) |
Update Crawler.php
Signed-off-by: Andy Xheli <andyxheli@gmail.com>
-rw-r--r-- | lib/Cron/Crawler.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Cron/Crawler.php b/lib/Cron/Crawler.php index 0d70db2..daf6d75 100644 --- a/lib/Cron/Crawler.php +++ b/lib/Cron/Crawler.php @@ -174,7 +174,11 @@ class Crawler extends TimedJob { // Check if the signature actually matches the downloaded content $certificate = openssl_get_publickey(file_get_contents(__DIR__ . '/../../appinfo/certificate.crt')); $verified = (bool)openssl_verify($feedBody, base64_decode($signature), $certificate, OPENSSL_ALGO_SHA512); - openssl_free_key($certificate); + + // PHP 8 automatically frees the key instance and deprecates the function + if (PHP_VERSION_ID < 80000) { + openssl_free_key($certificate); + } if (!$verified) { // Signature does not match |