From 5b2770aa34f0fb329492311080c101c03c493fb3 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Thu, 5 Aug 2021 17:08:55 +0200 Subject: Simplify the insert/update HTTP-POST params check Simplify the HTTP-POST parameter presence check in the administration controllers for creating and modifying entities. Since we already use fallback values for each attribute, we don't need a full param check. --- admin/user/insert.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'admin/user/insert.php') diff --git a/admin/user/insert.php b/admin/user/insert.php index 2d9e09f..48cbf65 100644 --- a/admin/user/insert.php +++ b/admin/user/insert.php @@ -23,7 +23,7 @@ $User = new ORM\Entities\User; #=============================================================================== # Check for insert request #=============================================================================== -if(HTTP::issetPOST('slug', 'username', 'password', 'fullname', 'mailaddr', 'body', 'argv', 'time_insert', 'time_update', 'insert')) { +if(HTTP::issetPOST('insert')) { $User->set('slug', HTTP::POST('slug') ?: generateSlug(HTTP::POST('username'))); $User->set('username', HTTP::POST('username') ?: NULL); $User->set('password', HTTP::POST('password') ? password_hash(HTTP::POST('password'), PASSWORD_BCRYPT, ['cost' => 10]) : FALSE); -- cgit v1.2.3