From 3ab0dbbb2c3fc58ba43f113ed5c73d161f972987 Mon Sep 17 00:00:00 2001 From: Florian Azizian <florian.azizian@maarch.org> Date: Fri, 20 Mar 2015 11:25:25 +0000 Subject: [PATCH] FEAT #2073 Add a case for phone in wash function --- core/trunk/core/class/class_functions.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/trunk/core/class/class_functions.php b/core/trunk/core/class/class_functions.php index 38c87be5212..d5c5bec6a2a 100644 --- a/core/trunk/core/class/class_functions.php +++ b/core/trunk/core/class/class_functions.php @@ -322,6 +322,16 @@ class functions $this->add_error($msg_error, _WRONG_FORMAT); return ""; } + case "phone": + if (preg_match("/^[\+0-9\-\.\(\)\s]*$/",$w_var)) + { + return $w_var; + } + else + { + $this->add_error($msg_error, _WRONG_FORMAT); + return ""; + } case "date": $date_pattern = "/^[0-3][0-9]-[0-1][0-9]-[1-2][0-9][0-9][0-9]$/"; if(preg_match($date_pattern,$w_var)) -- GitLab