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:
co-authored by
Tim Fry
FusionPBX
parent
ebbb2f1a72
commit
fef8165be2
@@ -94,7 +94,7 @@
|
||||
$menu_item_link = preg_replace('#[^a-zA-Z0-9_:\-\.\&\=\?\/]#', '', $menu_item_link);
|
||||
|
||||
//when a HTTP POST is available then process it
|
||||
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
if (count($_POST) > 0 && empty($_POST["persistformvar"])) {
|
||||
|
||||
if ($action == "update") {
|
||||
$menu_item_uuid = $_POST["menu_item_uuid"];
|
||||
@@ -110,10 +110,10 @@
|
||||
|
||||
//check for all required data
|
||||
$msg = '';
|
||||
if (strlen($menu_item_title) == 0) { $msg .= $text['message-required'].$text['label-title']."<br>\n"; }
|
||||
if (strlen($menu_item_category) == 0) { $msg .= $text['message-required'].$text['label-category']."<br>\n"; }
|
||||
//if (strlen($menu_item_link) == 0) { $msg .= $text['message-required'].$text['label-link']."<br>\n"; }
|
||||
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
if (empty($menu_item_title)) { $msg .= $text['message-required'].$text['label-title']."<br>\n"; }
|
||||
if (empty($menu_item_category)) { $msg .= $text['message-required'].$text['label-category']."<br>\n"; }
|
||||
//if (empty($menu_item_link)) { $msg .= $text['message-required'].$text['label-link']."<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";
|
||||
@@ -213,7 +213,7 @@
|
||||
unset($parameters);
|
||||
|
||||
//add a group to the menu
|
||||
if ($_REQUEST["a"] != "delete" && strlen($group_uuid_name) > 0 && permission_exists('menu_add')) {
|
||||
if ($_REQUEST["a"] != "delete" && !empty($group_uuid_name) && permission_exists('menu_add')) {
|
||||
$group_data = explode('|', $group_uuid_name);
|
||||
$group_uuid = $group_data[0];
|
||||
$group_name = $group_data[1];
|
||||
@@ -234,7 +234,7 @@
|
||||
}
|
||||
|
||||
//add the menu item label
|
||||
if ($_REQUEST["a"] != "delete" && strlen($menu_item_title) > 0 && permission_exists('menu_add')) {
|
||||
if ($_REQUEST["a"] != "delete" && !empty($menu_item_title) && permission_exists('menu_add')) {
|
||||
$sql = "select count(*) from v_menu_languages ";
|
||||
$sql .= "where menu_item_uuid = :menu_item_uuid ";
|
||||
$sql .= "and menu_language = :menu_language ";
|
||||
@@ -351,7 +351,7 @@
|
||||
if (is_array($menu_item_groups) && sizeof($menu_item_groups) != 0) {
|
||||
$assigned_groups = array();
|
||||
foreach ($menu_item_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'];
|
||||
}
|
||||
@@ -480,7 +480,7 @@
|
||||
if (is_array($menu_item_groups) && sizeof($menu_item_groups) != 0) {
|
||||
echo "<table cellpadding='0' cellspacing='0' border='0'>\n";
|
||||
foreach($menu_item_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 $field['group_name'].(($field['group_domain_uuid'] != '') ? "@".$_SESSION['domains'][$field['group_domain_uuid']]['domain_name'] : null);
|
||||
|
||||
Reference in New Issue
Block a user