summaryrefslogtreecommitdiff
path: root/includes/pages
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2017-11-21 19:00:42 +0100
committermsquare <msquare@notrademark.de>2017-11-21 19:00:42 +0100
commitbb2681a7c818f80b3c8de18d2f0f9a0889d9f731 (patch)
treea2d2b5e5d0a8afe06e7725f27c6f7a7815bcce5e /includes/pages
parentb95d4ece8ab28ff4821a8aeb471396ed30a94912 (diff)
add validation of dect numbers
Diffstat (limited to 'includes/pages')
-rw-r--r--includes/pages/guest_login.php7
-rw-r--r--includes/pages/user_settings.php7
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']);