From d5d2acc7d80920eef5f0ed779a3738a12d5db348 Mon Sep 17 00:00:00 2001 From: msquare Date: Sat, 1 Oct 2016 10:48:19 +0200 Subject: improve code style --- includes/controller/shifts_controller.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'includes/controller/shifts_controller.php') diff --git a/includes/controller/shifts_controller.php b/includes/controller/shifts_controller.php index 52162b9e..b29a819f 100644 --- a/includes/controller/shifts_controller.php +++ b/includes/controller/shifts_controller.php @@ -137,12 +137,12 @@ function shifts_json_export_all_controller() { function shifts_json_export_controller() { global $ical_shifts, $user; - if (isset($_REQUEST['key']) && preg_match("/^[0-9a-f]{32}$/", $_REQUEST['key'])) { - $key = $_REQUEST['key']; - } else { + if (! isset($_REQUEST['key']) || ! preg_match("/^[0-9a-f]{32}$/", $_REQUEST['key'])) { engelsystem_error("Missing key."); } + $key = $_REQUEST['key']; + $user = User_by_api_key($key); if ($user === false) { engelsystem_error("Unable to find user."); -- cgit v1.2.3-54-g00ecf