From e749490693eccd61e9ea9152fada33470e5492f7 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 31 Jan 2025 13:59:51 +0100 Subject: Pass PHPStan checkBenevolentUnionTypes (#7270) --- app/Models/Feed.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/Models') diff --git a/app/Models/Feed.php b/app/Models/Feed.php index dd508299d..953ffc918 100644 --- a/app/Models/Feed.php +++ b/app/Models/Feed.php @@ -1149,6 +1149,10 @@ class FreshRSS_Feed extends Minz_Model { file_put_contents($hubFilename, json_encode($hubJson)); } $ch = curl_init(); + if ($ch === false) { + Minz_Log::warning('curl_init() failed in ' . __METHOD__); + return false; + } curl_setopt_array($ch, [ CURLOPT_URL => $hubJson['hub'], CURLOPT_RETURNTRANSFER => true, @@ -1166,6 +1170,10 @@ class FreshRSS_Feed extends Minz_Model { ]); $response = curl_exec($ch); $info = curl_getinfo($ch); + if (!is_array($info)) { + Minz_Log::warning('curl_getinfo() failed in ' . __METHOD__); + return false; + } Minz_Log::warning('WebSub ' . ($state ? 'subscribe' : 'unsubscribe') . ' to ' . $url . ' via hub ' . $hubJson['hub'] . -- cgit v1.2.3