ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
tel.php
Go to the documentation of this file.
1<?php
2
13{
17 public $browsable = false;
18
22 public $may_omit_host = true;
23
30 public function doValidate(&$uri, $config, $context)
31 {
32 $uri->userinfo = null;
33 $uri->host = null;
34 $uri->port = null;
35
36 // Delete all non-numeric characters, non-x characters
37 // from phone number, EXCEPT for a leading plus sign.
38 $uri->path = preg_replace('/(?!^\+)[^\dx]/', '',
39 // Normalize e(x)tension to lower-case
40 str_replace('X', 'x', $uri->path));
41
42 return true;
43 }
44}
45
46// vim: et sw=4 sts=4
An exception for terminatinating execution or to throw for unit testing.
Validates tel (for phone numbers).
Definition: tel.php:13
$may_omit_host
@type bool
Definition: tel.php:22
doValidate(&$uri, $config, $context)
Definition: tel.php:30
$browsable
@type bool
Definition: tel.php:17
Validator for the components of a URI for a specific scheme.
Definition: URIScheme.php:7