Skip to content

Commit

Permalink
Merge pull request #332 from nextcloud/bugfix/noid/check-function-call
Browse files Browse the repository at this point in the history
fix: Correctly check result of function
  • Loading branch information
miaulalala authored May 15, 2024
2 parents 020b163 + ea9e089 commit 884bbde
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cron/Crawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ protected function loadFeed() {

// 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);
$verified = openssl_verify($feedBody, base64_decode($signature), $certificate, OPENSSL_ALGO_SHA512) === 1;

// PHP 8 automatically frees the key instance and deprecates the function
if (PHP_VERSION_ID < 80000) {
Expand Down

0 comments on commit 884bbde

Please sign in to comment.