fix: unset $_SESSION['phrase']
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2023-01-22 15:46:41 +08:00
parent 6fce5b6ca4
commit 0571beca45
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
2 changed files with 8 additions and 1 deletions

View File

@ -36,9 +36,13 @@ if ($_POST['image_upload_file_submit'] == 'submit') {
} }
if (!isset($_SESSION['phrase']) || !PhraseBuilder::comparePhrases($_SESSION['phrase'], $_POST['captcha'])) { if (!isset($_SESSION['phrase']) || !PhraseBuilder::comparePhrases($_SESSION['phrase'], $_POST['captcha'])) {
unset($_SESSION['phrase']);
throwError("bad_captcha"); throwError("bad_captcha");
} }
unset($_SESSION['phrase']);
if ($_FILES["image_upload_file"]["error"] > 0) { if ($_FILES["image_upload_file"]["error"] > 0) {
throwError($_FILES["image_upload_file"]["error"]); throwError($_FILES["image_upload_file"]["error"]);
} }

View File

@ -38,9 +38,13 @@ $forgot_form->handle = function (&$vdata) {
$password = $user["password"]; $password = $user["password"];
if (!isset($_SESSION['phrase']) || !PhraseBuilder::comparePhrases($_SESSION['phrase'], $_POST['captcha'])) { if (!isset($_SESSION['phrase']) || !PhraseBuilder::comparePhrases($_SESSION['phrase'], $_POST['captcha'])) {
unset($_SESSION['phrase']);
becomeMsgPage('验证码错误!'); becomeMsgPage('验证码错误!');
} }
unset($_SESSION['phrase']);
if (!$user['email']) { if (!$user['email']) {
becomeMsgPage('用户未填写邮件地址,请联系管理员重置!'); becomeMsgPage('用户未填写邮件地址,请联系管理员重置!');
} }
@ -99,7 +103,6 @@ EOD;
} }
}; };
$forgot_form->submit_button_config['align'] = 'offset'; $forgot_form->submit_button_config['align'] = 'offset';
$forgot_form->runAtServer(); $forgot_form->runAtServer();
?> ?>
<?php echoUOJPageHeader('找回密码') ?> <?php echoUOJPageHeader('找回密码') ?>