mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 01:49:05 +00:00
don't format non numbers
This commit is contained in:
@@ -2892,11 +2892,23 @@ SWITCH_DECLARE(char *) switch_format_number(const char *num)
|
||||
char *r;
|
||||
size_t len;
|
||||
const char *p = num;
|
||||
|
||||
if(*p == '+') {
|
||||
|
||||
if (!p) {
|
||||
return p;
|
||||
}
|
||||
|
||||
if (zstr(p)) {
|
||||
return strdup(p);
|
||||
}
|
||||
|
||||
if (*p == '+') {
|
||||
p++;
|
||||
}
|
||||
|
||||
if (!switch_is_number(p)) {
|
||||
return strdup(p);
|
||||
}
|
||||
|
||||
len = strlen(p);
|
||||
|
||||
/* region 1, TBD add more....*/
|
||||
@@ -2907,7 +2919,6 @@ SWITCH_DECLARE(char *) switch_format_number(const char *num)
|
||||
} else {
|
||||
r = strdup(num);
|
||||
}
|
||||
|
||||
|
||||
return r;
|
||||
}
|
||||
|
Reference in New Issue
Block a user