From 455e41720068740c523bfc4b15cf30e3811e4281 Mon Sep 17 00:00:00 2001 From: msquare Date: Tue, 4 Oct 2016 16:16:00 +0200 Subject: fix variable naming problems --- includes/controller/shifts_controller.php | 8 ++++---- includes/pages/admin_rooms.php | 2 +- includes/pages/user_shifts.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'includes') diff --git a/includes/controller/shifts_controller.php b/includes/controller/shifts_controller.php index aa1ac5d9..3300c0d2 100644 --- a/includes/controller/shifts_controller.php +++ b/includes/controller/shifts_controller.php @@ -88,12 +88,12 @@ function shift_edit_controller() { $msg .= error(_("The ending time has to be after the starting time."), true); } - foreach ($needed_angel_types_source as $type) { - if (isset($_REQUEST['type_' . $type['id']]) && preg_match("/^[0-9]+$/", trim($_REQUEST['type_' . $type['id']]))) { - $needed_angel_types[$type['id']] = trim($_REQUEST['type_' . $type['id']]); + foreach ($needed_angel_types as $needed_angeltype_id => $needed_angeltype_name) { + if (isset($_REQUEST['type_' . $needed_angeltype_id]) && test_request_int('type_' . $needed_angeltype_id)) { + $needed_angel_types[$needed_angeltype_id] = trim($_REQUEST['type_' . $needed_angeltype_id]); } else { $valid = false; - $msg .= error(sprintf(_("Please check your input for needed angels of type %s."), $type['name']), true); + $msg .= error(sprintf(_("Please check your input for needed angels of type %s."), $needed_angeltype_name), true); } } diff --git a/includes/pages/admin_rooms.php b/includes/pages/admin_rooms.php index 7641eb18..61c0a2c0 100644 --- a/includes/pages/admin_rooms.php +++ b/includes/pages/admin_rooms.php @@ -118,7 +118,7 @@ function admin_rooms() { engelsystem_error("Unable to load angeltype."); } if ($angeltype != null) { - NeededAngelType_add(null, $angeltype_id, $room_id, $count); + NeededAngelType_add(null, $angeltype_id, $room_id, $angeltype_count); $needed_angeltype_info[] = $angeltype['name'] . ": " . $angeltype_count; } } diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php index 9fd306c9..ad211181 100644 --- a/includes/pages/user_shifts.php +++ b/includes/pages/user_shifts.php @@ -9,7 +9,7 @@ function shifts_title() { * Start different controllers for deleting shifts and shift_entries, edit shifts and add shift entries. */ function user_shifts() { - global $user, $privileges; + global $user; if (User_is_freeloader($user)) { redirect(page_link_to('user_myshifts')); -- cgit v1.2.3-54-g00ecf