tel: ajouter / comme séparateur valide

This commit is contained in:
Jephté Clain 2024-05-03 11:29:17 +04:00
parent 5fa5f718d2
commit 8cb71ab7d7
1 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@
namespace nur\data\types;
class TelephoneType extends RegexpType {
const PATTERN = '/^[0-9+, .()-]+/';
const PATTERN = '/^[0-9+, .()-\/]+/';
const PATTERN_NORMALIZED = '/^(\+?[0-9 ,]+)$/';
const COD_PAYS = [
@ -261,7 +261,7 @@ class TelephoneType extends RegexpType {
protected function extractParsedValue(array $ms) {
$tel = $ms[0];
$tel = preg_replace('/[ .()-]/', "", $tel);
$tel = preg_replace('/[ .()-\/]/', "", $tel);
$tel = preg_replace('/\+/', "00", $tel);
$ntel = preg_replace('/[^0-9]/', "", $tel);
# tel est le numéro avec chiffres et virgule