mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-06-05 22:09:38 +02:00
Fix per PHP 8.1
This commit is contained in:
24
editor.php
24
editor.php
@@ -40,20 +40,22 @@ if (!empty($id_record)) {
|
||||
Util\Query::setSegments(true);
|
||||
}
|
||||
// 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)) {
|
||||
$conditions_to_remove = [];
|
||||
if (!empty($query)){
|
||||
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)) {
|
||||
$condition = $table_name.'.'.$condition;
|
||||
if (!empty($table_name)) {
|
||||
$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;
|
||||
|
||||
@@ -511,7 +511,7 @@ if (Auth::check()) {
|
||||
$count = 0;
|
||||
if (!empty($plugin['options2'])){
|
||||
$opt = json_decode($plugin['options2'], true);
|
||||
}else{
|
||||
}else if (!empty($plugin['options'])){
|
||||
$opt = json_decode($plugin['options'], true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user