mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
Improve captcha validation error messages for user creation and API handling
This commit is contained in:
parent
7e35cd4d7b
commit
baf9025b00
2 changed files with 1 additions and 2 deletions
|
@ -38,7 +38,6 @@ if (empty($ignoreCaptcha)) {
|
||||||
$valid = Captcha::validation($_POST['captcha']);
|
$valid = Captcha::validation($_POST['captcha']);
|
||||||
if (!$valid) {
|
if (!$valid) {
|
||||||
$obj->error = __("The captcha is wrong");
|
$obj->error = __("The captcha is wrong");
|
||||||
$obj->error .= ', '.__("Reload the captcha and try again");
|
|
||||||
die(json_encode($obj));
|
die(json_encode($obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4004,7 +4004,7 @@ class API extends PluginAbstract
|
||||||
require_once $global['systemRootPath'] . 'objects/captcha.php';
|
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, reload it and try again");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$ignoreCaptcha = 1;
|
$ignoreCaptcha = 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue