Skip to content

Commit

Permalink
#646 Поправил ошибку сохранения настроек. Нечисловые номера не сохран…
Browse files Browse the repository at this point in the history
…ялись.
  • Loading branch information
apor committed Dec 5, 2023
1 parent e399dba commit 5600b82
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/PBXCoreREST/Lib/Extensions/DataStructure.php
Expand Up @@ -128,17 +128,12 @@ public function __construct(array $data)
if (empty($this->mobile_dialstring)) {
$this->mobile_dialstring = $this->mobile_number;
}

if (!empty($this->fwd_forwarding)){
$this->fwd_forwarding = preg_replace('/\D/', '', $this->fwd_forwarding);
}
if (!empty($this->fwd_forwardingonunavailable)){
$this->fwd_forwardingonunavailable = preg_replace('/\D/', '', $this->fwd_forwardingonunavailable);
}
if (!empty($this->fwd_forwardingonbusy)){
$this->fwd_forwardingonbusy = preg_replace('/\D/', '', $this->fwd_forwardingonbusy);
$properties = ['fwd_forwarding', 'fwd_forwardingonunavailable', 'fwd_forwardingonbusy'];
foreach ($properties as $property) {
if (!empty($this->{$property}) && !in_array($this->{$property}, ['voicemail', 'busy', 'hangup'])) {
$this->{$property} = preg_replace('/\D/', '', $this->{$property});
}
}

}

/**
Expand Down

0 comments on commit 5600b82

Please sign in to comment.