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

View File

@@ -199,7 +199,7 @@
$invalid[] = $text['label-email'];
}
if (strlen($password) > 0) {
if (!empty($password)) {
if (is_numeric($required['length']) && $required['length'] != 0) {
if (strlen($password) < $required['length']) {
$invalid[] = $text['label-characters'];
@@ -634,7 +634,7 @@
$name = $row['user_setting_name'];
$category = $row['user_setting_category'];
$subcategory = $row['user_setting_subcategory'];
if (strlen($subcategory) == 0) {
if (empty($subcategory)) {
//$$category[$name] = $row['domain_setting_value'];
$user_settings[$category][$name] = $row['user_setting_value'];
}
@@ -648,7 +648,7 @@
}
//set the defaults
if (strlen($user_enabled) == 0) { $user_enabled = "true"; }
if (empty($user_enabled)) { $user_enabled = "true"; }
//create token
$object = new token;
@@ -914,7 +914,7 @@
echo "</select>\n";
echo "<br />\n";
echo $text['description-contact']."\n";
if (strlen($contact_uuid) > 0) {
if (!empty($contact_uuid)) {
echo " <a href=\"".PROJECT_PATH."/app/contacts/contact_edit.php?id=".urlencode($contact_uuid)."\">".$text['description-contact_view']."</a>\n";
}
echo " </td>";
@@ -963,7 +963,7 @@
if (is_array($user_groups)) {
echo "<table cellpadding='0' cellspacing='0' border='0'>\n";
foreach($user_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'>";
echo escape($field['group_name']).(($field['group_domain_uuid'] != '') ? "@".$_SESSION['domains'][$field['group_domain_uuid']]['domain_name'] : null);
@@ -1040,7 +1040,7 @@
echo " <td class='vncell' valign='top'>".$text['label-api_key']."</td>";
echo " <td class='vtable'>\n";
echo " <input type='text' class='formfld' style='width: 250px; display: none;' name='api_key' id='api_key' value=\"".escape($api_key)."\" >";
if (strlen($api_key) == 0) {
if (empty($api_key)) {
//generate api key
echo button::create(['type'=>'button',
'label'=>$text['button-generate'],
@@ -1069,7 +1069,7 @@
document.getElementById('button-api_key_view').style.display = 'inline';"]);
}
if (strlen($text['description-api_key']) > 0) {
if (!empty($text['description-api_key'])) {
echo " <br />".$text['description-api_key']."<br />\n";
}
echo " </td>";
@@ -1146,7 +1146,7 @@
'onclick'=>"document.getElementById('user_totp_secret').value = '';
document.getElementById('frm').submit();"]);
}
if (strlen($user_totp_secret) == 0) {
if (empty($user_totp_secret)) {
echo " <br />".$text['description-user_totp_secret']."<br />\n";
}
else {