Skip to content

Commit 083fb1a

Browse files
committed
Maintenance: Updated $request->get instance to use input
1 parent a2bb5bd commit 083fb1a

38 files changed

Lines changed: 107 additions & 107 deletions

app/Access/Controllers/ForgotPasswordController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ public function sendResetLinkEmail(Request $request)
4545
);
4646

4747
if ($response === Password::RESET_LINK_SENT) {
48-
$this->logActivity(ActivityType::AUTH_PASSWORD_RESET, $request->get('email'));
48+
$this->logActivity(ActivityType::AUTH_PASSWORD_RESET, $request->input('email'));
4949
}
5050

5151
if (in_array($response, [Password::RESET_LINK_SENT, Password::INVALID_USER, Password::RESET_THROTTLED])) {
52-
$message = trans('auth.reset_password_sent', ['email' => $request->get('email')]);
52+
$message = trans('auth.reset_password_sent', ['email' => $request->input('email')]);
5353
$this->showSuccessNotification($message);
5454

5555
return redirect('/password/email')->with('status', trans($response));

app/Access/Controllers/LoginController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ public function getLogin(Request $request)
3232
{
3333
$socialDrivers = $this->socialDriverManager->getActive();
3434
$authMethod = config('auth.method');
35-
$preventInitiation = $request->get('prevent_auto_init') === 'true';
35+
$preventInitiation = $request->input('prevent_auto_init') === 'true';
3636

3737
if ($request->has('email')) {
3838
session()->flashInput([
39-
'email' => $request->get('email'),
40-
'password' => (config('app.env') === 'demo') ? $request->get('password', '') : '',
39+
'email' => $request->input('email'),
40+
'password' => (config('app.env') === 'demo') ? $request->input('password', '') : '',
4141
]);
4242
}
4343

@@ -62,7 +62,7 @@ public function getLogin(Request $request)
6262
public function login(Request $request)
6363
{
6464
$this->validateLogin($request);
65-
$username = $request->get($this->username());
65+
$username = $request->input($this->username());
6666

6767
// Check login throttling attempts to see if they've gone over the limit
6868
if ($this->hasTooManyLoginAttempts($request)) {

app/Access/Controllers/MfaBackupCodesController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function ($attribute, $value, $fail) use ($codeService, $codes) {
8484
],
8585
]);
8686

87-
$updatedCodes = $codeService->removeInputCodeFromSet($request->get('code'), $codes);
87+
$updatedCodes = $codeService->removeInputCodeFromSet($request->input('code'), $codes);
8888
MfaValue::upsertWithValue($user, MfaValue::METHOD_BACKUP_CODES, $updatedCodes);
8989

9090
$mfaSession->markVerifiedForUser($user);

app/Access/Controllers/MfaController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ public function remove(string $method)
5151
*/
5252
public function verify(Request $request)
5353
{
54-
$desiredMethod = $request->get('method');
54+
$desiredMethod = $request->input('method');
5555
$userMethods = $this->currentOrLastAttemptedUser()
5656
->mfaValues()
5757
->get(['id', 'method'])
5858
->groupBy('method');
5959

6060
// Basic search for the default option for a user.
61-
// (Prioritises totp over backup codes)
61+
// (Prioritises TOTP over backup codes)
6262
$method = $userMethods->has($desiredMethod) ? $desiredMethod : $userMethods->keys()->sort()->reverse()->first();
6363
$otherMethods = $userMethods->keys()->filter(function ($userMethod) use ($method) {
6464
return $method !== $userMethod;

app/Access/Controllers/ResetPasswordController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function reset(Request $request)
4848

4949
// Here we will attempt to reset the user's password. If it is successful we
5050
// will update the password on an actual user model and persist it to the
51-
// database. Otherwise we will parse the error and return the response.
51+
// database. Otherwise, we will parse the error and return the response.
5252
$credentials = $request->only('email', 'password', 'password_confirmation', 'token');
5353
$response = Password::broker()->reset($credentials, function (User $user, string $password) {
5454
$user->password = Hash::make($password);
@@ -63,7 +63,7 @@ public function reset(Request $request)
6363
// redirect them back to where they came from with their error message.
6464
return $response === Password::PASSWORD_RESET
6565
? $this->sendResetResponse()
66-
: $this->sendResetFailedResponse($request, $response, $request->get('token'));
66+
: $this->sendResetFailedResponse($request, $response, $request->input('token'));
6767
}
6868

6969
/**

app/Access/Controllers/Saml2Controller.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function sls()
7878
*/
7979
public function startAcs(Request $request)
8080
{
81-
$samlResponse = $request->get('SAMLResponse', null);
81+
$samlResponse = $request->input('SAMLResponse', null);
8282

8383
if (empty($samlResponse)) {
8484
$this->showErrorNotification(trans('errors.saml_fail_authed', ['system' => config('saml2.name')]));
@@ -100,7 +100,7 @@ public function startAcs(Request $request)
100100
*/
101101
public function processAcs(Request $request)
102102
{
103-
$acsId = $request->get('id', null);
103+
$acsId = $request->input('id', null);
104104
$cacheKey = 'saml2_acs:' . $acsId;
105105
$samlResponse = null;
106106

app/Access/Controllers/SocialController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function callback(Request $request, string $socialDriver)
6767
if ($request->has('error') && $request->has('error_description')) {
6868
throw new SocialSignInException(trans('errors.social_login_bad_response', [
6969
'socialAccount' => $socialDriver,
70-
'error' => $request->get('error_description'),
70+
'error' => $request->input('error_description'),
7171
]), '/login');
7272
}
7373

app/Access/Controllers/UserInviteController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function setPassword(Request $request, string $token)
6767
}
6868

6969
$user = $this->userRepo->getById($userId);
70-
$user->password = Hash::make($request->get('password'));
70+
$user->password = Hash::make($request->input('password'));
7171
$user->email_confirmed = true;
7272
$user->save();
7373

app/Activity/Controllers/AuditLogController.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ public function index(Request $request)
1717
$this->checkPermission(Permission::SettingsManage);
1818
$this->checkPermission(Permission::UsersManage);
1919

20-
$sort = $request->get('sort', 'activity_date');
21-
$order = $request->get('order', 'desc');
20+
$sort = $request->input('sort', 'activity_date');
21+
$order = $request->input('order', 'desc');
2222
$listOptions = (new SimpleListOptions('', $sort, $order))->withSortOptions([
2323
'created_at' => trans('settings.audit_table_date'),
2424
'type' => trans('settings.audit_table_event'),
2525
]);
2626

2727
$filters = [
28-
'event' => $request->get('event', ''),
29-
'date_from' => $request->get('date_from', ''),
30-
'date_to' => $request->get('date_to', ''),
31-
'user' => $request->get('user', ''),
32-
'ip' => $request->get('ip', ''),
28+
'event' => $request->input('event', ''),
29+
'date_from' => $request->input('date_from', ''),
30+
'date_to' => $request->input('date_to', ''),
31+
'user' => $request->input('user', ''),
32+
'ip' => $request->input('ip', ''),
3333
];
3434

3535
$query = Activity::query()

app/Activity/Controllers/FavouriteController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function __construct(
2020
public function index(Request $request, QueryTopFavourites $topFavourites)
2121
{
2222
$viewCount = 20;
23-
$page = intval($request->get('page', 1));
23+
$page = intval($request->input('page', 1));
2424
$favourites = $topFavourites->run($viewCount + 1, (($page - 1) * $viewCount));
2525

2626
$hasMoreLink = ($favourites->count() > $viewCount) ? url('/favourites?page=' . ($page + 1)) : null;

0 commit comments

Comments
 (0)