Update switch_music_on_hold.php (#4648)

removes potential "Warning: sizeof(): Parameter must be an array or an object that implements Countable"
This commit is contained in:
chansizzle 2019-09-24 13:38:32 -06:00 committed by FusionPBX
parent d8a98c6709
commit 8e2439074f
1 changed files with 2 additions and 2 deletions

View File

@ -75,7 +75,7 @@ include "root.php";
require_once "app/recordings/resources/classes/switch_recordings.php";
$recordings_c = new switch_recordings;
$recordings = $recordings_c->list_recordings();
if (sizeof($recordings) > 0) {
if (is_array($recordings) && sizeof($recordings) > 0) {
$select .= " <optgroup label='".$text['label-recordings']."'>";
foreach($recordings as $recording_value => $recording_name){
$select .= " <option value='".$recording_value."' ".(($selected == $recording_value) ? 'selected="selected"' : null).">".$recording_name."</option>\n";
@ -102,7 +102,7 @@ include "root.php";
unset($sql, $parameters, $streams, $row);
}
//add additional options
if (sizeof($options) > 0) {
if (is_array($options) && sizeof($options) > 0) {
$select .= " <optgroup label='".$text['label-others']."'>";
$select .= $options;
$select .= " </optgroup>\n";