From a0722c6d149b253a320976a64aad6e57ab1cccd7 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Thu, 5 Aug 2021 18:19:19 +0200 Subject: Don't check return value of insert/delete methods Don't check the return value of the Repository's "insert" and "delete" methods in the administration controllers for creating and modifying entities since a PDOException is thrown if an error occurs. --- admin/post/insert.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'admin/post/insert.php') diff --git a/admin/post/insert.php b/admin/post/insert.php index 1a8cac7..1b04ecc 100644 --- a/admin/post/insert.php +++ b/admin/post/insert.php @@ -37,9 +37,8 @@ if(HTTP::issetPOST('insert')) { if(HTTP::issetPOST(['token' => Application::getSecurityToken()])) { try { - if($PostRepository->insert($Post)) { - HTTP::redirect(Application::getAdminURL('post/')); - } + $PostRepository->insert($Post); + HTTP::redirect(Application::getAdminURL('post/')); } catch(PDOException $Exception) { $messages[] = $Exception->getMessage(); } -- cgit v1.2.3