Add is_array and hide irrelevant -ERR no reply

This commit is contained in:
FusionPBX 2021-06-02 17:12:01 -06:00 committed by GitHub
parent 661035f8fb
commit d24d5c1676
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 63 additions and 58 deletions

View File

@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2020
Portions created by the Initial Developer are Copyright (C) 2008-2021
the Initial Developer. All Rights Reserved.
Contributor(s):
@ -311,6 +311,8 @@ if (!class_exists('registrations')) {
//loop through registrations
if ($fp) {
//check if registrations exist
if (is_array($registrations)) {
foreach ($registrations as $registration) {
//validate the submitted profile
@ -374,13 +376,16 @@ if (!class_exists('registrations')) {
}
}
}
//set message
if (is_array($response_api)) {
$message = $response_message;
foreach ($response_api as $registration_user => $response) {
if (trim($response['command']) != '-ERR no reply') {
$message .= "<br>\n<strong>".$registration_user."</strong>: ".$response['command'];
}
}
message::add($message, 'positive', '7000');
}