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
+1 -1
View File
@@ -25,7 +25,7 @@
*/
//if the recordings directory doesn't exist then create it
if (is_array($_SESSION['switch']['recordings']) && strlen($_SESSION['switch']['recordings']['dir']."/".$domain_name) > 0) {
if (is_array($_SESSION['switch']['recordings']) && !empty($_SESSION['switch']['recordings']['dir']."/".$domain_name)) {
if (!is_readable($_SESSION['switch']['recordings']['dir']."/".$domain_name)) {
mkdir($_SESSION['switch']['recordings']['dir']."/".$domain_name, 0770, true);
}
+4 -4
View File
@@ -72,7 +72,7 @@
$recording_name = str_replace("'", '', $recording_name);
}
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
if (count($_POST) > 0 && empty($_POST["persistformvar"])) {
//get recording uuid to edit
$recording_uuid = $_POST["recording_uuid"];
@@ -101,9 +101,9 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
//check for all required data
$msg = '';
if (strlen($recording_filename) == 0) { $msg .= $text['label-edit-file']."<br>\n"; }
if (strlen($recording_name) == 0) { $msg .= $text['label-edit-recording']."<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
if (empty($recording_filename)) { $msg .= $text['label-edit-file']."<br>\n"; }
if (empty($recording_name)) { $msg .= $text['label-edit-recording']."<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";
+2 -2
View File
@@ -289,7 +289,7 @@
//add the search term
$search = strtolower($_GET["search"]);
if (strlen($search) > 0) {
if (!empty($search)) {
$sql_search = "and (";
$sql_search .= "lower(recording_name) like :search ";
$sql_search .= "or lower(recording_filename) like :search ";
@@ -492,7 +492,7 @@
echo " </td>\n";
}
if ($_GET['show'] == "all" && permission_exists('recording_all')) {
if (strlen($_SESSION['domains'][$row['domain_uuid']]['domain_name']) > 0) {
if (!empty($_SESSION['domains'][$row['domain_uuid']]['domain_name'])) {
$domain = $_SESSION['domains'][$row['domain_uuid']]['domain_name'];
}
else {
@@ -135,7 +135,7 @@ if (!class_exists('switch_recordings')) {
//delete recording files
if (is_array($filenames) && @sizeof($filenames) != 0) {
foreach ($filenames as $filename) {
if (isset($filename) && strlen($filename) > 0 && file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$filename)) {
if (isset($filename) && !empty($filename) && file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$filename)) {
@unlink($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$filename);
}
}