Skip to content
Snippets Groups Projects
Commit 5a5883c9 authored by Dominic Petit's avatar Dominic Petit Committed by Christian Kuhn
Browse files

[BUGFIX] Allow comma and semicolon in TelephoneLinkHandler

Allow to save a phone link with a comma or a semicolon.

Resolves: #101721
Releases: main, 12.4, 11.5
Change-Id: I54e19fbfb2b1b184db4454a19728f08e70cddc4a
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80654


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent a69163aa
Branches
Tags
No related merge requests found
......@@ -27,7 +27,7 @@ class TelephoneLinkHandler implements LinkHandlingInterface
*/
public function asString(array $parameters): string
{
$telephoneNumber = preg_replace('/(?:[^\d\+]+)/', '', $parameters['telephone']);
$telephoneNumber = preg_replace('/(?:[^\d\+,;]+)/', '', $parameters['telephone']);
return 'tel:' . $telephoneNumber;
}
......
......@@ -67,6 +67,15 @@ final class TelephoneLinkHandlerTest extends UnitTestCase
],
'tel:+43123455678',
],
'telephone number with comma and semicolon' => [
[
'telephone' => 'tel:+43 123 45 56 78,; 1234',
],
[
'telephone' => '+43 123 45 56 78,; 1234',
],
'tel:+43123455678,;1234',
],
];
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment