Fix per PHP 8.1

This commit is contained in:
Luca 2022-03-22 18:59:25 +01:00
parent 289d99cc7c
commit 9313e08351
2 changed files with 14 additions and 12 deletions

View File

@ -40,6 +40,7 @@ if (!empty($id_record)) {
Util\Query::setSegments(true);
}
// Rimozione della condizione deleted_at IS NULL per visualizzare anche i record eliminati
if (!empty($query)){
if (preg_match('/[`]*([a-z0-9_]*)[`]*[\.]*([`]*deleted_at[`]* IS NULL)/i', $query, $m)) {
$conditions_to_remove = [];
@ -55,6 +56,7 @@ if (preg_match('/[`]*([a-z0-9_]*)[`]*[\.]*([`]*deleted_at[`]* IS NULL)/i', $quer
$query = str_replace($conditions_to_remove, '', $query);
$query = str_replace($condition, '', $query);
}
}
$has_access = !empty($query) ? $dbo->fetchNum($query) !== 0 : true;

View File

@ -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);
}