mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 03:33:49 +00:00
Save only numbers and an optional * prefix.
Users may add phone number with formatting and this breaks call forward. So this removes white spaces and formatting to ensure the call forwarding works.
This commit is contained in:
@@ -173,17 +173,11 @@
|
||||
|
||||
//call forward config
|
||||
if (permission_exists('call_forward')) {
|
||||
//trim hidden characters
|
||||
$forward_all_destination = trim($forward_all_destination);
|
||||
$forward_busy_destination = trim($forward_busy_destination);
|
||||
$forward_no_answer_destination = trim($forward_no_answer_destination);
|
||||
$forward_user_not_registered_destination = trim($forward_user_not_registered_destination);
|
||||
|
||||
//sanitize the destinations
|
||||
$forward_all_destination = str_replace('$', '', $forward_all_destination);
|
||||
$forward_busy_destination = str_replace('$', '', $forward_busy_destination);
|
||||
$forward_no_answer_destination = str_replace('$', '', $forward_no_answer_destination);
|
||||
$forward_user_not_registered_destination = str_replace('$', '', $forward_user_not_registered_destination);
|
||||
$forward_all_destination = preg_replace('#[^\*0-9]#', '', $forward_all_destination);
|
||||
$forward_busy_destination = preg_replace('#[^\*0-9]#', '', $forward_busy_destination);
|
||||
$forward_no_answer_destination = preg_replace('#[^\*0-9]#', '', $forward_no_answer_destination);
|
||||
$forward_user_not_registered_destination = preg_replace('#[^\*0-9]#', '', $forward_user_not_registered_destination);
|
||||
|
||||
//build the array
|
||||
$array['extensions'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
@@ -239,11 +233,8 @@
|
||||
$destination_found = false;
|
||||
foreach ($destinations as $field) {
|
||||
if ($field['destination'] != '') {
|
||||
//trim hidden characters
|
||||
$field['destination'] = trim($field['destination']);
|
||||
|
||||
//sanitize the destination
|
||||
$field['destination'] = str_replace('$', '', $field['destination']);
|
||||
$field['destination'] = preg_replace('#[^\*0-9]#', '', $field['destination']);
|
||||
|
||||
//build the array
|
||||
$array['follow_me'][0]['follow_me_destinations'][$d]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
|
||||
Reference in New Issue
Block a user