Skip to content

Commit ee1453d

Browse files
committed
Prevent coutable errors in php 7 or higher when retrieving extensions
1 parent dc2fbb2 commit ee1453d

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

framework/html/pbxapi/controllers/extensions.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -419,19 +419,25 @@ public function get($f3, $from_child=0) {
419419
}
420420
}
421421
}
422+
423+
if(!isset($complete_array['device_options'])) { $complete_array['device_options']=array(); }
422424
if(count($complete_array['device_options'])==0) {
423425
unset($complete_array['device_options']);
424426
}
425-
if(count($complete_array['extension_options'])==0) {
427+
if(!isset($complete_array['extension_options'])) { $complete_array['extension_options']=array(); }
428+
if (count($complete_array['extension_options'])==0) {
426429
unset($complete_array['extension_options']);
427430
}
428-
if(count($complete_array['recording'])==0) {
431+
if(!isset($complete_array['recording'])) { $complete_array['recording']=array(); }
432+
if (count($complete_array['recording'])==0) {
429433
unset($complete_array['recording']);
430434
}
431-
if(count($complete_array['callerid_override'])==0) {
435+
if(!isset($complete_array['callerid_override'])) { $complete_array['callerid_override']=array(); }
436+
if (count($complete_array['callerid_override']) == 0) {
432437
unset($complete_array['callerid_override']);
433438
}
434-
if(count($complete_array['destination'])==0) {
439+
if(!isset($complete_array['destination'])) { $complete_array['destination']=array(); }
440+
if (count($complete_array['destination']) == 0) {
435441
unset($complete_array['destination']);
436442
}
437443
}

0 commit comments

Comments
 (0)