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/category/insert.php | 2 +- admin/category/update.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'admin/category') diff --git a/admin/category/insert.php b/admin/category/insert.php index f6f193e..773bb29 100644 --- a/admin/category/insert.php +++ b/admin/category/insert.php @@ -23,7 +23,7 @@ $Category = new ORM\Entities\Category; #=============================================================================== # Check for insert request #=============================================================================== -if(HTTP::issetPOST('parent', 'slug', 'name', 'body', 'argv', 'time_insert', 'time_update', 'insert')) { +if(HTTP::issetPOST('insert')) { $Category->set('parent', HTTP::POST('parent') ?: NULL); $Category->set('slug', HTTP::POST('slug') ?: generateSlug(HTTP::POST('name'))); $Category->set('name', HTTP::POST('name') ?: NULL); diff --git a/admin/category/update.php b/admin/category/update.php index 7cee587..4791d79 100644 --- a/admin/category/update.php +++ b/admin/category/update.php @@ -25,7 +25,7 @@ if(!$Category = $CategoryRepository->find(HTTP::GET('id'))) { #=============================================================================== # Check for update request #=============================================================================== -if(HTTP::issetPOST('parent', 'slug', 'name', 'body', 'argv', 'time_insert', 'time_update', 'update')) { +if(HTTP::issetPOST('update')) { $Category->set('slug', HTTP::POST('slug') ?: generateSlug(HTTP::POST('name'))); $Category->set('name', HTTP::POST('name') ?: NULL); $Category->set('body', HTTP::POST('body') ?: NULL); -- cgit v1.2.3