Skip to content

Commit ea83024

Browse files
committed
fix: corrected request object handling for changing passwords
1 parent 6bf445a commit ea83024

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

phpmyfaq/src/phpMyFAQ/Auth/AuthDatabase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public function checkCredentials(
170170
throw new AuthException(User::ERROR_USER_NOT_FOUND);
171171
}
172172

173-
// if login not unique, raise an error, but continue
173+
// if login not unique, raise an error but continue
174174
if ($numRows > 1) {
175175
throw new AuthException(User::ERROR_USER_LOGIN_NOT_UNIQUE);
176176
}

phpmyfaq/src/phpMyFAQ/Controller/Administration/PasswordChangeController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function update(Request $request): Response
5858
{
5959
$this->userHasPermission(PermissionType::PASSWORD_CHANGE);
6060

61-
$csrfToken = Filter::filterVar($request->attributes->get('pmf-csrf-token'), FILTER_SANITIZE_SPECIAL_CHARS);
61+
$csrfToken = Filter::filterVar($request->request->get('pmf-csrf-token'), FILTER_SANITIZE_SPECIAL_CHARS);
6262

6363
if (!Token::getInstance($this->container->get(id: 'session'))->verifyToken('password', $csrfToken)) {
6464
throw new Exception('Invalid CSRF token');
@@ -73,10 +73,10 @@ public function update(Request $request): Response
7373
$authSource->enableReadOnly();
7474
}
7575

76-
$oldPassword = Filter::filterVar($request->attributes->get('faqpassword_old'), FILTER_SANITIZE_SPECIAL_CHARS);
77-
$newPassword = Filter::filterVar($request->attributes->get('faqpassword'), FILTER_SANITIZE_SPECIAL_CHARS);
76+
$oldPassword = Filter::filterVar($request->request->get('faqpassword_old'), FILTER_SANITIZE_SPECIAL_CHARS);
77+
$newPassword = Filter::filterVar($request->request->get('faqpassword'), FILTER_SANITIZE_SPECIAL_CHARS);
7878
$retypedPassword = Filter::filterVar(
79-
$request->attributes->get('faqpassword_confirm'),
79+
$request->request->get('faqpassword_confirm'),
8080
FILTER_SANITIZE_SPECIAL_CHARS,
8181
);
8282

0 commit comments

Comments
 (0)