Fix per PHP 8.1
This commit is contained in:
parent
289d99cc7c
commit
9313e08351
24
editor.php
24
editor.php
|
@ -40,20 +40,22 @@ if (!empty($id_record)) {
|
||||||
Util\Query::setSegments(true);
|
Util\Query::setSegments(true);
|
||||||
}
|
}
|
||||||
// Rimozione della condizione deleted_at IS NULL per visualizzare anche i record eliminati
|
// Rimozione della condizione deleted_at IS NULL per visualizzare anche i record eliminati
|
||||||
if (preg_match('/[`]*([a-z0-9_]*)[`]*[\.]*([`]*deleted_at[`]* IS NULL)/i', $query, $m)) {
|
if (!empty($query)){
|
||||||
$conditions_to_remove = [];
|
if (preg_match('/[`]*([a-z0-9_]*)[`]*[\.]*([`]*deleted_at[`]* IS NULL)/i', $query, $m)) {
|
||||||
|
$conditions_to_remove = [];
|
||||||
|
|
||||||
$condition = trim($m[0]);
|
$condition = trim($m[0]);
|
||||||
|
|
||||||
if (!empty($table_name)) {
|
if (!empty($table_name)) {
|
||||||
$condition = $table_name.'.'.$condition;
|
$condition = $table_name.'.'.$condition;
|
||||||
|
}
|
||||||
|
|
||||||
|
$conditions_to_remove[] = ' AND '.$condition;
|
||||||
|
$conditions_to_remove[] = $condition.' AND ';
|
||||||
|
|
||||||
|
$query = str_replace($conditions_to_remove, '', $query);
|
||||||
|
$query = str_replace($condition, '', $query);
|
||||||
}
|
}
|
||||||
|
|
||||||
$conditions_to_remove[] = ' AND '.$condition;
|
|
||||||
$conditions_to_remove[] = $condition.' AND ';
|
|
||||||
|
|
||||||
$query = str_replace($conditions_to_remove, '', $query);
|
|
||||||
$query = str_replace($condition, '', $query);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$has_access = !empty($query) ? $dbo->fetchNum($query) !== 0 : true;
|
$has_access = !empty($query) ? $dbo->fetchNum($query) !== 0 : true;
|
||||||
|
|
|
@ -511,7 +511,7 @@ if (Auth::check()) {
|
||||||
$count = 0;
|
$count = 0;
|
||||||
if (!empty($plugin['options2'])){
|
if (!empty($plugin['options2'])){
|
||||||
$opt = json_decode($plugin['options2'], true);
|
$opt = json_decode($plugin['options2'], true);
|
||||||
}else{
|
}else if (!empty($plugin['options'])){
|
||||||
$opt = json_decode($plugin['options'], true);
|
$opt = json_decode($plugin['options'], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue