From bb2681a7c818f80b3c8de18d2f0f9a0889d9f731 Mon Sep 17 00:00:00 2001 From: msquare Date: Tue, 21 Nov 2017 19:00:42 +0100 Subject: [PATCH] add validation of dect numbers --- includes/pages/guest_login.php | 7 ++++++- includes/pages/user_settings.php | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/includes/pages/guest_login.php b/includes/pages/guest_login.php index 9e71e180..76c944c5 100644 --- a/includes/pages/guest_login.php +++ b/includes/pages/guest_login.php @@ -183,7 +183,12 @@ function guest_register() $tel = strip_request_item('tel'); } if ($request->has('dect')) { - $dect = strip_request_item('dect'); + if(strlen(strip_request_item('dect')) <= 5) { + $dect = strip_request_item('dect'); + } else { + $valid = false; + error(_('For dect numbers are only 5 digits allowed.')); + } } if ($request->has('mobile')) { $mobile = strip_request_item('mobile'); diff --git a/includes/pages/user_settings.php b/includes/pages/user_settings.php index 0ba8bbcb..83d593ad 100644 --- a/includes/pages/user_settings.php +++ b/includes/pages/user_settings.php @@ -78,7 +78,12 @@ function user_settings_main($user_source, $enable_tshirt_size, $tshirt_sizes) $user_source['Vorname'] = strip_request_item('prename', $user_source['Vorname']); $user_source['Alter'] = strip_request_item('age', $user_source['Alter']); $user_source['Telefon'] = strip_request_item('tel', $user_source['Telefon']); - $user_source['DECT'] = strip_request_item('dect', $user_source['DECT']); + if(strlen(strip_request_item('dect')) <= 5) { + $user_source['DECT'] = strip_request_item('dect', $user_source['DECT']); + } else { + $valid = false; + error(_('For dect numbers are only 5 digits allowed.')); + } $user_source['Handy'] = strip_request_item('mobile', $user_source['Handy']); $user_source['Hometown'] = strip_request_item('hometown', $user_source['Hometown']);