1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00

Add captcha validation to API request handling

This commit is contained in:
Daniel Neto 2025-07-03 10:11:23 -03:00
parent 0adec8a983
commit c98ce764a9

View file

@ -4000,6 +4000,8 @@ class API extends PluginAbstract
if(empty($_REQUEST['captcha'])){ if(empty($_REQUEST['captcha'])){
return new ApiObject("Captcha is required"); return new ApiObject("Captcha is required");
} }
require_once $global['systemRootPath'] . 'objects/captcha.php';
$valid = Captcha::validation($_REQUEST['captcha']); $valid = Captcha::validation($_REQUEST['captcha']);
if(!$valid){ if(!$valid){
return new ApiObject("Captcha is wrong"); return new ApiObject("Captcha is wrong");