From c7254c5de3e48117030bf399cb1ebdd2099d5ff8 Mon Sep 17 00:00:00 2001 From: Daniel Neto Date: Wed, 23 Apr 2025 16:22:26 -0300 Subject: [PATCH] Fix API secret validation logic to return error for invalid secrets https://github.com/WWBN/AVideo/issues/9999 --- plugin/API/API.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/API/API.php b/plugin/API/API.php index b0b8f485a2..c6cf5463f8 100644 --- a/plugin/API/API.php +++ b/plugin/API/API.php @@ -862,7 +862,7 @@ class API extends PluginAbstract global $global; $obj = $this->startResponseObject($parameters); $obj->videos_id = $parameters['videos_id']; - if (self::isAPISecretValid()) { + if (!self::isAPISecretValid()) { if (!User::canWatchVideoWithAds($obj->videos_id)) { return new ApiObject("You cannot watch this video"); } @@ -3562,7 +3562,7 @@ class API extends PluginAbstract { global $global; - if (self::isAPISecretValid()) { + if (!self::isAPISecretValid()) { return new ApiObject("Invalid APISecret"); } $name = "get_api_subscribers" . json_encode($parameters);