Fix all PHP 8.1 messages for upgrade.php

This commit is contained in:
markjcrane
2023-05-17 10:07:49 -06:00
parent 6816921f47
commit 6d7e125743
22 changed files with 215 additions and 152 deletions
+5 -5
View File
@@ -35,7 +35,7 @@ if ($domains_processed == 1) {
$sql .= "and (t.call_center_queue_uuid is null or t.call_center_agent_uuid is null) ";
$database = new database;
$tiers = $database->select($sql, null, 'all');
if (is_array($tiers) && @sizeof($tiers) != 0) {
if (!empty($tiers)) {
foreach ($tiers as $index => &$row) {
if ($row['call_center_queue_uuid'] == null && $row['queue_uuid'] != null) {
$array['call_center_tiers'][$index]['call_center_queue_uuid'] = $row['queue_uuid'];
@@ -74,7 +74,7 @@ if ($domains_processed == 1) {
$database = new database;
$call_center_queues = $database->select($sql, null, 'all');
$id = 0;
if (is_array($call_center_queues)) {
if (!empty($call_center_queues)) {
foreach ($call_center_queues as $row) {
//get the application and data
@@ -100,7 +100,7 @@ if ($domains_processed == 1) {
$dialplan_xml .= " </condition>\n";
$dialplan_xml .= " <condition field=\"destination_number\" expression=\"^(callcenter\+)?".xml::sanitize($row["queue_extension"])."$\">\n";
$dialplan_xml .= " <action application=\"answer\" data=\"\"/>\n";
if (is_uuid($row['call_center_queue_uuid'])) {
if (!empty($row['call_center_queue_uuid']) && is_uuid($row['call_center_queue_uuid'])) {
$dialplan_xml .= " <action application=\"set\" data=\"call_center_queue_uuid=".xml::sanitize($row['call_center_queue_uuid'])."\"/>\n";
}
if (is_numeric($row['queue_extension'])) {
@@ -111,7 +111,7 @@ if ($domains_processed == 1) {
if ($row['queue_time_base_score_sec'] != '') {
$dialplan_xml .= " <action application=\"set\" data=\"cc_base_score=".xml::sanitize($row['queue_time_base_score_sec'])."\"/>\n";
}
if ($row['queue_greeting'] != '') {
if (!empty($row['queue_greeting'])) {
$greeting_array = explode(':', $row['queue_greeting']);
if (count($greeting_array) == 1) {
$dialplan_xml .= " <action application=\"playback\" data=\"".xml::sanitize($queue_greeting_path)."\"/>\n";
@@ -158,7 +158,7 @@ if ($domains_processed == 1) {
unset ($prep_statement);
//save the array to the database
if (is_array($array)) {
if (!empty($array)) {
//add the dialplan permission
$p = new permissions;
$p->add("dialplan_add", "temp");