Frytimo pr patches for php8.1 (#6630)

* Passing null to parameter #2 ($string) of type string is deprecated

* Passing null to parameter #1 ($string) of type string is deprecated

* php 8.1 fixes

* php 8.1 fixes - replace strlen($var) > 0 with !empty($var)

* php 8.1 fixes - replace ${var} with {$var}

* php 8.1 fixes - replace ${var} with {$var}

* php 8.1 fixes - replace ${var} with {$var}

* php 8.1 fixes - replace ${var} with {$var}

* php 8.1 fixes - strlower with null

* php 8.1 fixes - strreplace with null

* php 8.1 fixes - passing null to base64_decode

* php 8.1 fixes - check for false and check for null on $this->dir

* php 8.1 fixes - remove assignment of $db variable to modules object

* php 8.1 fixes - avoid sending null to substr

* php 8.1 fixes - change ${var} to {$var}

* php 8.1 fixes - check for null before preg_replace

* php 8.1 fixes - remove setting db variable on domains object

* php 8.1 fixes - set empty string if $row['domain_setting_subcategory'] is null

* php 8.1 fixes - set empty string if $_REQUEST['show'] is not available

* php 8.1 fixes

* php 8.1 fixes - correct $_POST checking syntax

* php 8.1 fixes - correct $_POST variables

* php 8.1 fixes

* Use brackets consistently

* Update user_setting_edit.php

* Change to not empty

* Update device.php

* Update text.php

---------

Co-authored-by: Tim Fry <tim@voipstratus.com>
Co-authored-by: FusionPBX <markjcrane@gmail.com>
This commit is contained in:
frytimo
2023-05-05 10:46:37 -06:00
committed by GitHub
co-authored by Tim Fry FusionPBX
parent ebbb2f1a72
commit fef8165be2
230 changed files with 1948 additions and 1937 deletions
+11 -11
View File
@@ -84,7 +84,7 @@
}
//process the user data and save it to the database
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
if (count($_POST) > 0 && empty($_POST["persistformvar"])) {
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
@@ -94,7 +94,7 @@
}
//process the http post data by submitted action
if ($_POST['action'] != '' && strlen($_POST['action']) > 0) {
if ($_POST['action'] != '' && !empty($_POST['action'])) {
//prepare the array(s)
//send the array to the database class
@@ -128,13 +128,13 @@
//check for all required data
$msg = '';
//if (strlen($dashboard_name) == 0) { $msg .= $text['message-required']." ".$text['label-dashboard_name']."<br>\n"; }
//if (strlen($dashboard_path) == 0) { $msg .= $text['message-required']." ".$text['label-dashboard_path']."<br>\n"; }
//if (strlen($dashboard_groups) == 0) { $msg .= $text['message-required']." ".$text['label-dashboard_groups']."<br>\n"; }
//if (strlen($dashboard_order) == 0) { $msg .= $text['message-required']." ".$text['label-dashboard_order']."<br>\n"; }
//if (strlen($dashboard_enabled) == 0) { $msg .= $text['message-required']." ".$text['label-dashboard_enabled']."<br>\n"; }
//if (strlen($dashboard_description) == 0) { $msg .= $text['message-required']." ".$text['label-dashboard_description']."<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
//if (empty($dashboard_name)) { $msg .= $text['message-required']." ".$text['label-dashboard_name']."<br>\n"; }
//if (empty($dashboard_path)) { $msg .= $text['message-required']." ".$text['label-dashboard_path']."<br>\n"; }
//if (empty($dashboard_groups)) { $msg .= $text['message-required']." ".$text['label-dashboard_groups']."<br>\n"; }
//if (empty($dashboard_order)) { $msg .= $text['message-required']." ".$text['label-dashboard_order']."<br>\n"; }
//if (empty($dashboard_enabled)) { $msg .= $text['message-required']." ".$text['label-dashboard_enabled']."<br>\n"; }
//if (empty($dashboard_description)) { $msg .= $text['message-required']." ".$text['label-dashboard_description']."<br>\n"; }
if (!empty($msg) && empty($_POST["persistformvar"])) {
require_once "resources/header.php";
require_once "resources/persist_form_var.php";
echo "<div align='center'>\n";
@@ -283,7 +283,7 @@
if (is_array($dashboard_groups) && sizeof($dashboard_groups) != 0) {
$assigned_groups = array();
foreach ($dashboard_groups as $field) {
if (strlen($field['group_name']) > 0) {
if (!empty($field['group_name'])) {
if (is_uuid($field['group_uuid'])) {
$assigned_groups[] = $field['group_uuid'];
}
@@ -356,7 +356,7 @@
if (is_array($dashboard_groups) && sizeof($dashboard_groups) != 0) {
echo "<table cellpadding='0' cellspacing='0' border='0'>\n";
foreach($dashboard_groups as $field) {
if (strlen($field['group_name']) > 0) {
if (!empty($field['group_name'])) {
echo "<tr>\n";
echo " <td class='vtable' style='white-space: nowrap; padding-right: 30px;' nowrap='nowrap'>\n";
echo $field['group_name'].(($field['group_domain_uuid'] != '') ? "@".$_SESSION['domains'][$field['group_domain_uuid']]['domain_name'] : null);