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 13:46:37 -03:00
committed by GitHub
parent ebbb2f1a72
commit fef8165be2
230 changed files with 1948 additions and 1937 deletions
+8 -8
View File
@@ -107,13 +107,13 @@ if (!function_exists('get_db_field_names')) {
if ($db_type == "sqlite") {
//set the document_root
if (strlen($document_root) == 0) {
if (empty($document_root)) {
$document_root = $_SERVER["DOCUMENT_ROOT"];
}
//prepare the database connection
if (strlen($db_name) == 0) {
//if (strlen($_SERVER["SERVER_NAME"]) == 0) { $_SERVER["SERVER_NAME"] = "http://localhost"; }
if (empty($db_name)) {
//if (empty($_SERVER["SERVER_NAME"])) { $_SERVER["SERVER_NAME"] = "http://localhost"; }
$server_name = $_SERVER["SERVER_NAME"];
$server_name = str_replace ("www.", "", $server_name);
//$server_name = str_replace (".", "_", $server_name);
@@ -220,12 +220,12 @@ if ($db_type == "mysql") {
//$mysql_connection = mysqli_connect($db_host, $db_username, $db_password,$db_name) or die("Error " . mysqli_error($link));
}
//mysql pdo connection
if (strlen($db_host) == 0 && strlen($db_port) == 0) {
if (strlen($db_host) == 0 && empty($db_port)) {
//if both host and port are empty use the unix socket
$db = new PDO("mysql:host=$db_host;unix_socket=/var/run/mysqld/mysqld.sock;dbname=$db_name;charset=utf8;", $db_username, $db_password);
}
else {
if (strlen($db_port) == 0) {
if (empty($db_port)) {
//leave out port if it is empty
$db = new PDO("mysql:host=$db_host;dbname=$db_name;charset=utf8;", $db_username, $db_password, array(
PDO::ATTR_ERRMODE,
@@ -252,8 +252,8 @@ if ($db_type == "pgsql") {
if (!isset($db_secure)) {
$db_secure = false;
}
if (strlen($db_host) > 0) {
if (strlen($db_port) == 0) { $db_port = "5432"; }
if (!empty($db_host)) {
if (empty($db_port)) { $db_port = "5432"; }
if ($db_secure == true) {
$db = new PDO("pgsql:host=$db_host port=$db_port dbname=$db_name user=$db_username password=$db_password sslmode=verify-ca sslrootcert=$db_cert_authority");
}
@@ -354,7 +354,7 @@ if ($db_type == "odbc") {
}
//set the domain_uuid variable from the session
if (strlen($_SESSION["domain_uuid"]) > 0) {
if (!empty($_SESSION["domain_uuid"])) {
$domain_uuid = $_SESSION["domain_uuid"];
}
else {