From 631b5eb1b28a5b4eb74df79bfab8ee18191a67d9 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 16 Dec 2017 13:44:30 -0600 Subject: [PATCH] Fix form requests --- app/Http/Requests/Admin/AdminFormRequest.php | 5 +---- app/Http/Requests/Admin/UserFormRequest.php | 9 +-------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/app/Http/Requests/Admin/AdminFormRequest.php b/app/Http/Requests/Admin/AdminFormRequest.php index 7f7ce8cb7..0e6293733 100644 --- a/app/Http/Requests/Admin/AdminFormRequest.php +++ b/app/Http/Requests/Admin/AdminFormRequest.php @@ -44,9 +44,6 @@ abstract class AdminFormRequest extends FormRequest */ public function normalize($only = []) { - return array_merge( - $this->only($only), - $this->intersect(array_keys($this->rules())) - ); + return $this->all(empty($only) ? array_keys($this->rules()) : $only); } } diff --git a/app/Http/Requests/Admin/UserFormRequest.php b/app/Http/Requests/Admin/UserFormRequest.php index d705c86ed..757be4341 100644 --- a/app/Http/Requests/Admin/UserFormRequest.php +++ b/app/Http/Requests/Admin/UserFormRequest.php @@ -1,11 +1,4 @@ . - * - * This software is licensed under the terms of the MIT license. - * https://opensource.org/licenses/MIT - */ namespace Pterodactyl\Http\Requests\Admin; @@ -33,7 +26,7 @@ class UserFormRequest extends AdminFormRequest { if ($this->method === 'PATCH') { return array_merge( - $this->intersect('password'), + $this->all(['password']), $this->only(['email', 'username', 'name_first', 'name_last', 'root_admin', 'ignore_connection_error']) ); }