fix clear cache request

This commit is contained in:
2025-11-28 16:20:24 +05:00
parent 0a79cf6922
commit f40b08e49a

View File

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