Skip to content

Commit

Permalink
Fixing scrutinizer issues re unneeded variables secret and status_mfa
Browse files Browse the repository at this point in the history
  • Loading branch information
kbwhizz committed Nov 20, 2024
1 parent 68eb190 commit 6dce555
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
6 changes: 2 additions & 4 deletions app/Http/RequestHandlers/RegisterAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,13 @@ public function handle(ServerRequestInterface $request): ResponseInterface
$password = Validator::parsedBody($request)->string('password');
$realname = Validator::parsedBody($request)->string('realname');
$username = Validator::parsedBody($request)->string('username');
$secret = Validator::parsedBody($request)->string('secret');

try {
if ($this->captcha_service->isRobot($request)) {
throw new Exception(I18N::translate('Please try again.'));
}

$this->doValidateRegistration($request, $username, $email, $realname, $comments, $password, $secret);
$this->doValidateRegistration($request, $username, $email, $realname, $comments, $password);

Session::forget('register_comments');
Session::forget('register_email');
Expand Down Expand Up @@ -249,8 +248,7 @@ private function doValidateRegistration(
string $email,
string $realname,
string $comments,
#[\SensitiveParameter] string $password,
string $secret
#[\SensitiveParameter] string $password
): void {
// All fields are required
if ($username === '' || $email === '' || $realname === '' || $comments === '' || $password === '') {
Expand Down
1 change: 0 additions & 1 deletion app/Http/RequestHandlers/UserAddAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface
$real_name = Validator::parsedBody($request)->string('real_name');
$email = Validator::parsedBody($request)->string('email');
$password = Validator::parsedBody($request)->string('password');
$secret = "";

$errors = false;

Expand Down
2 changes: 0 additions & 2 deletions app/Http/RequestHandlers/UserEditAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface
$real_name = Validator::parsedBody($request)->string('real_name');
$email = Validator::parsedBody($request)->string('email');
$password = Validator::parsedBody($request)->string('password');
$secret = Validator::parsedBody($request)->string('secret');
$theme = Validator::parsedBody($request)->string('theme');
$language = Validator::parsedBody($request)->string('language');
$timezone = Validator::parsedBody($request)->string('timezone');
Expand All @@ -85,7 +84,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface
$canadmin = Validator::parsedBody($request)->boolean('canadmin', false);
$visible_online = Validator::parsedBody($request)->boolean('visible-online', false);
$verified = Validator::parsedBody($request)->boolean('verified', false);
$status_mfa = Validator::parsedBody($request)->boolean('status-mfa', false);
$approved = Validator::parsedBody($request)->boolean('approved', false);

$edit_user = $this->user_service->find($user_id);
Expand Down

0 comments on commit 6dce555

Please sign in to comment.