Przeglądaj źródła

E.164 format support - contact_phone_edit.php (#1581)

The + prefix is being removed, this should be ignored for the very start of the string, resolution below.

Line 69.
Replace:
$phone_number = preg_replace('{\D}', '', $phone_number);
With:
$phone_number = preg_replace('{(?!^\+)[\D]}', '', $phone_number);
SJS87 9 lat temu
rodzic
commit
07c259a44e
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      contact_phone_edit.php

+ 1 - 1
contact_phone_edit.php

@@ -66,7 +66,7 @@ if (strlen($_GET["contact_uuid"]) > 0) {
 		$phone_description = check_str($_POST["phone_description"]);
 
 		//remove any phone number formatting
-		$phone_number = preg_replace('{\D}', '', $phone_number);
+		$phone_number = preg_replace('{(?!^\+)[\D]}', '', $phone_number);
 
 		//use custom label if set
 		$phone_label = ($phone_label_custom != '') ? $phone_label_custom : $phone_label;