diff --git a/class/class.database.php b/class/class.database.php index 99c51ce..577b723 100644 --- a/class/class.database.php +++ b/class/class.database.php @@ -1551,7 +1551,7 @@ public function Close() } - /** +/** * Метод, предназначенный для очищения кеша запросов * * @param $cache_id @@ -1561,12 +1561,20 @@ public function Close() { $request = request_get_settings($cache_id); - $cache_from_id = BASE_DIR . '/tmp/cache/sql/requests/settings/' . (trim($request->Id) > '' - ? trim($request->Id) . '/' + // ИСПРАВЛЕНИЕ PHP 8: Проверка объекта + if (!is_object($request)) + { + return false; + } + + // ИСПРАВЛЕНИЕ PHP 8: Добавляем (string) для защиты trim() + $cache_from_id = BASE_DIR . '/tmp/cache/sql/requests/settings/' . (trim((string)$request->Id) > '' + ? trim((string)$request->Id) . '/' : ''); - $cache_from_alias = BASE_DIR . '/tmp/cache/sql/requests/settings/' . (trim($request->request_alias) > '' - ? trim($request->request_alias) . '/' + // ИСПРАВЛЕНИЕ PHP 8: Добавляем (string) для защиты trim() + $cache_from_alias = BASE_DIR . '/tmp/cache/sql/requests/settings/' . (trim((string)$request->request_alias) > '' + ? trim((string)$request->request_alias) . '/' : ''); return (rrmdir($cache_from_id) AND rrmdir($cache_from_alias));