From ec924901392f088d334622f806b9449b17b75d7b Mon Sep 17 00:00:00 2001 From: danbrellis Date: Fri, 10 Nov 2023 10:25:42 -0500 Subject: [PATCH] feat: Allows commas to be included in tel URI (#389) * Allows commas in tel URI scheme validator (addresses #388) * Adds comment explaining 8429f7b --- library/HTMLPurifier/URIScheme/tel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/HTMLPurifier/URIScheme/tel.php b/library/HTMLPurifier/URIScheme/tel.php index 1ea12226..dfad8efc 100644 --- a/library/HTMLPurifier/URIScheme/tel.php +++ b/library/HTMLPurifier/URIScheme/tel.php @@ -33,9 +33,9 @@ class HTMLPurifier_URIScheme_tel extends HTMLPurifier_URIScheme $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)));