Skip to content

Commit

Permalink
feat: Allows commas to be included in tel URI (#389)
Browse files Browse the repository at this point in the history
* Allows commas in tel URI scheme validator (addresses #388)

* Adds comment explaining 8429f7b
  • Loading branch information
danbrellis authored Nov 10, 2023
1 parent ab21ea7 commit ec92490
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/HTMLPurifier/URIScheme/tel.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ public function doValidate(&$uri, $config, $context)
$uri->host = null;
$uri->port = null;

// Delete all non-numeric characters, non-x characters
// Delete all non-numeric characters, commas, and non-x characters
// from phone number, EXCEPT for a leading plus sign.
$uri->path = preg_replace('/(?!^\+)[^\dx]/', '',
$uri->path = preg_replace('/(?!^\+)[^\dx,]/', '',
// Normalize e(x)tension to lower-case
str_replace('X', 'x', rawurldecode($uri->path)));

Expand Down

0 comments on commit ec92490

Please sign in to comment.