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:
parent
d8a98c6709
commit
8e2439074f
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Reference in New Issue