1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00

Fix API secret validation logic to return error for invalid secrets

https://github.com/WWBN/AVideo/issues/9999
This commit is contained in:
Daniel Neto 2025-04-23 16:22:26 -03:00
parent b4860712cf
commit c7254c5de3

View file

@ -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);