Replace is_array with !empty

This commit is contained in:
FusionPBX
2023-05-10 22:25:10 -06:00
committed by GitHub
parent 020b1414aa
commit eccae62149

View File

@@ -50,7 +50,7 @@
$sql .= " ) \n";
$sql .= " and (missed_call = true or bridge_uuid is null) ";
$sql .= " and hangup_cause <> 'LOSE_RACE' ";
if (is_array($assigned_extensions) && sizeof($assigned_extensions) != 0) {
if (!empty($assigned_extensions)) {
$x = 0;
foreach ($assigned_extensions as $assigned_extension_uuid => $assigned_extension) {
$sql_where_array[] = "extension_uuid = :assigned_extension_uuid_".$x;
@@ -59,7 +59,7 @@
$parameters['destination_number_'.$x] = $assigned_extension;
$x++;
}
if (is_array($sql_where_array) && sizeof($sql_where_array) != 0) {
if (!empty($sql_where_array)) {
$sql .= "and (".implode(' or ', $sql_where_array).") \n";
}
unset($sql_where_array);
@@ -70,7 +70,7 @@
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
if (!isset($database)) { $database = new database; }
$result = $database->select($sql, $parameters, 'all');
$num_rows = is_array($result) ? sizeof($result) : 0;
$num_rows = !empty($result) ? sizeof($result) : 0;
//define row styles
$c = 0;
@@ -189,4 +189,4 @@
echo "<span class='hud_expander' onclick=\"$('#hud_missed_calls_details').slideToggle('fast');\"><span class='fas fa-ellipsis-h'></span></span>";
echo "</div>\n";
?>
?>