aboutsummaryrefslogtreecommitdiffstats
path: root/admin/post
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2021-08-05 17:08:55 +0200
committerThomas Lange <code@nerdmind.de>2021-08-05 17:17:31 +0200
commit5b2770aa34f0fb329492311080c101c03c493fb3 (patch)
treee1a36f3109a76b8b38414c4b2c81f3edbece2b31 /admin/post
parentd677315331796d52bd1bcf5908964a53958469d6 (diff)
downloadblog-5b2770aa34f0fb329492311080c101c03c493fb3.tar.gz
blog-5b2770aa34f0fb329492311080c101c03c493fb3.tar.xz
blog-5b2770aa34f0fb329492311080c101c03c493fb3.zip
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.
Diffstat (limited to 'admin/post')
-rw-r--r--admin/post/insert.php2
-rw-r--r--admin/post/update.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/admin/post/insert.php b/admin/post/insert.php
index bad55ae..1a8cac7 100644
--- a/admin/post/insert.php
+++ b/admin/post/insert.php
@@ -25,7 +25,7 @@ $Post = new ORM\Entities\Post;
#===============================================================================
# Check for insert request
#===============================================================================
-if(HTTP::issetPOST('category', 'user', 'slug', 'name', 'body', 'argv', 'time_insert', 'time_update', 'insert')) {
+if(HTTP::issetPOST('insert')) {
$Post->set('category', HTTP::POST('category') ?: NULL);
$Post->set('user', HTTP::POST('user'));
$Post->set('slug', HTTP::POST('slug') ?: generateSlug(HTTP::POST('name')));
diff --git a/admin/post/update.php b/admin/post/update.php
index e68b3ec..b35c379 100644
--- a/admin/post/update.php
+++ b/admin/post/update.php
@@ -27,7 +27,7 @@ if(!$Post = $PostRepository->find(HTTP::GET('id'))) {
#===============================================================================
# Check for update request
#===============================================================================
-if(HTTP::issetPOST('category', 'user', 'slug', 'name', 'body', 'argv', 'time_insert', 'time_update', 'update')) {
+if(HTTP::issetPOST('update')) {
$Post->set('category', HTTP::POST('category') ?: NULL);
$Post->set('user', HTTP::POST('user'));
$Post->set('slug', HTTP::POST('slug') ?: generateSlug(HTTP::POST('name')));