From fe58e4f4220d6685b91bf516374e33936e1075e3 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sun, 14 Jan 2018 17:47:26 +0100 Subject: database: updated checks for selectOne --- includes/controller/shifttypes_controller.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'includes/controller/shifttypes_controller.php') diff --git a/includes/controller/shifttypes_controller.php b/includes/controller/shifttypes_controller.php index 4e7cd92c..bc9c5c52 100644 --- a/includes/controller/shifttypes_controller.php +++ b/includes/controller/shifttypes_controller.php @@ -22,8 +22,7 @@ function shifttype_delete_controller() } $shifttype = ShiftType($request->input('shifttype_id')); - - if ($shifttype == null) { + if (empty($shifttype)) { redirect(page_link_to('shifttypes')); } @@ -58,7 +57,7 @@ function shifttype_edit_controller() if ($request->has('shifttype_id')) { $shifttype = ShiftType($request->input('shifttype_id')); - if ($shifttype == null) { + if (empty($shifttype)) { error(_('Shifttype not found.')); redirect(page_link_to('shifttypes')); } @@ -120,12 +119,12 @@ function shifttype_controller() redirect(page_link_to('shifttypes')); } $shifttype = ShiftType($request->input('shifttype_id')); - if ($shifttype == null) { + if (empty($shifttype)) { redirect(page_link_to('shifttypes')); } - $angeltype = null; - if ($shifttype['angeltype_id'] != null) { + $angeltype = []; + if (!empty($shifttype['angeltype_id'])) { $angeltype = AngelType($shifttype['angeltype_id']); } -- cgit v1.2.3-54-g00ecf