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:
parent
b4860712cf
commit
c7254c5de3
1 changed files with 2 additions and 2 deletions
|
@ -862,7 +862,7 @@ class API extends PluginAbstract
|
||||||
global $global;
|
global $global;
|
||||||
$obj = $this->startResponseObject($parameters);
|
$obj = $this->startResponseObject($parameters);
|
||||||
$obj->videos_id = $parameters['videos_id'];
|
$obj->videos_id = $parameters['videos_id'];
|
||||||
if (self::isAPISecretValid()) {
|
if (!self::isAPISecretValid()) {
|
||||||
if (!User::canWatchVideoWithAds($obj->videos_id)) {
|
if (!User::canWatchVideoWithAds($obj->videos_id)) {
|
||||||
return new ApiObject("You cannot watch this video");
|
return new ApiObject("You cannot watch this video");
|
||||||
}
|
}
|
||||||
|
@ -3562,7 +3562,7 @@ class API extends PluginAbstract
|
||||||
{
|
{
|
||||||
global $global;
|
global $global;
|
||||||
|
|
||||||
if (self::isAPISecretValid()) {
|
if (!self::isAPISecretValid()) {
|
||||||
return new ApiObject("Invalid APISecret");
|
return new ApiObject("Invalid APISecret");
|
||||||
}
|
}
|
||||||
$name = "get_api_subscribers" . json_encode($parameters);
|
$name = "get_api_subscribers" . json_encode($parameters);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue