Provisioning: Updates to resolve PHP 8.1 warnings.

This commit is contained in:
fusionate 2023-07-17 22:52:03 +00:00
parent 0a2d29b20d
commit c4f3565a15
No known key found for this signature in database
2 changed files with 6 additions and 6 deletions

View File

@ -296,7 +296,7 @@
}
//check the cidr range
if (is_array($_SESSION['provision']["cidr"])) {
if (!empty($_SESSION['provision']["cidr"]) && is_array($_SESSION['provision']["cidr"])) {
$found = false;
foreach($_SESSION['provision']["cidr"] as $cidr) {
if (check_cidr($cidr, $_SERVER['REMOTE_ADDR'])) {
@ -312,7 +312,7 @@
//http authentication - digest
if (!empty($provision["http_auth_username"]) && empty($provision["http_auth_type"])) { $provision["http_auth_type"] = "digest"; }
if (!empty($provision["http_auth_username"]) && $provision["http_auth_type"] === "digest" && $provision["http_auth_enabled"] === "true") {
if (!empty($provision["http_auth_username"]) && $provision["http_auth_type"] === "digest" && !empty($provision["http_auth_enabled"]) && $provision["http_auth_enabled"] === "true") {
//function to parse the http auth header
function http_digest_parse($txt) {
//protect against missing data

View File

@ -212,8 +212,8 @@
$x = 0;
foreach ($database_contacts as &$row) {
$uuid = $row['contact_uuid'];
$phone_label = strtolower($row['phone_label']);
$contact_category = strtolower($row['contact_category']);
$phone_label = strtolower($row['phone_label'] ?? '');
$contact_category = strtolower($row['contact_category'] ?? '');
$contact = array();
$contacts[] = &$contact;
@ -234,7 +234,7 @@
$contact['phone_extension'] = $row['phone_extension'];
}
$numbers[$x]['line_number'] = $line['line_number'];
$numbers[$x]['line_number'] = $line['line_number'] ?? null;
$numbers[$x]['phone_label'] = $phone_label;
$numbers[$x]['phone_number'] = $row['phone_number'];
$numbers[$x]['phone_extension'] = $row['phone_extension'];
@ -905,7 +905,7 @@
}
//get the extensions and add them to the contacts array
if (is_uuid($device_uuid) && is_uuid($domain_uuid) && $_SESSION['provision']['contact_extensions']['boolean'] == "true") {
if (is_uuid($device_uuid) && is_uuid($domain_uuid) && !empty($_SESSION['provision']['contact_extensions']['boolean']) && $_SESSION['provision']['contact_extensions']['boolean'] == "true") {
//get contacts from the database
$sql = "select extension_uuid as contact_uuid, directory_first_name, directory_last_name, ";
$sql .= "effective_caller_id_name, effective_caller_id_number, ";