Browse Source

Update functions.php

FusionPBX 5 years ago
parent
commit
0412b6e1b7
1 changed files with 3 additions and 2 deletions
  1. 3 2
      resources/functions.php

+ 3 - 2
resources/functions.php

@@ -1702,8 +1702,9 @@ function number_pad($number,$n) {
 				}
 				}
 			//add prefix
 			//add prefix
 				if (strlen($prefix) > 0) {
 				if (strlen($prefix) > 0) {
-					if (strlen($prefix) == 1) {
-						$prefix = $prefix.'?';
+					if (strlen($prefix) > 0 && strlen($prefix) < 4) {
+						$plus = (substr($string, 0, 1) == "+") ? '' : '\+?';
+						$prefix = $plus.$prefix.'?';
 					}
 					}
 					else {
 					else {
 						$prefix = '(?:'.$prefix.')?';
 						$prefix = '(?:'.$prefix.')?';