From 60a8431c5816d37405498f933e06d5b1c6cccd13 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 27 Apr 2017 15:37:28 +0200 Subject: [locationinfo] Check for valid serverid when saving location config --- modules-available/locationinfo/page.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'modules-available/locationinfo/page.inc.php') diff --git a/modules-available/locationinfo/page.inc.php b/modules-available/locationinfo/page.inc.php index 3562ccb3..bda6549b 100644 --- a/modules-available/locationinfo/page.inc.php +++ b/modules-available/locationinfo/page.inc.php @@ -70,6 +70,11 @@ class Page_LocationInfo extends Page Message::addError('location.invalid-location-id', $locationid); Util::redirect('?do=locationinfo'); } + $serverid = Request::post('serverid', 0, 'int'); + if ($serverid === 0) { + Message::addError('main.value-invalid', 'serverid', 0); + Util::redirect('?do=locationinfo'); + } $result['language'] = Request::post('language', 'en', 'string'); $result['mode'] = Request::post('mode', 1, 'int'); $result['vertical'] = Request::post('vertical', false, 'bool'); @@ -88,7 +93,6 @@ class Page_LocationInfo extends Page if ($result['calupdate'] < 120) { $result['calupdate'] = 120; } - $serverid = Request::post('serverid', 0, 'int'); $serverlocationid = Request::post('serverlocationid', '', 'string'); Database::exec("INSERT INTO `locationinfo_locationconfig` (locationid, serverid, serverlocationid, config, lastcalendarupdate) -- cgit v1.2.3-55-g7522