fix for PHP-8.4

This commit is contained in:
2025-11-24 19:55:54 +05:00
parent 245c667ccb
commit 04dde3c337
4 changed files with 38 additions and 27 deletions

View File

@@ -60,22 +60,22 @@
while (!feof($fp))
{
// ИСПРАВЛЕНИЕ: Добавляем обязательные параметры: разделитель (','), ограничитель ('"'), экранирование ('\\')
// ИСПРАВЛЕНИЕ: Добавляем обязательные параметры: разделитель (','), ограничитель ('"'), экранирование ('\')
$event = fgetcsv($fp, $_slice, ',', '"', '\\');
if (empty($event[0]) || count($event) < 3) {
continue;
}
$_lines[] = [
'log_time' => $event['0'] ?? '',
$_lines[] = [
'log_time' => $event['0'] ?? '',
'log_ip' => $event['1'] ?? '',
'log_url' => $event['2'] ?? '',
'log_user_id' => $event['3'] ?? '',
'log_user_name' => $event['4'] ?? '',
'log_text' => $event['5'] ?? '',
'log_type' => $event['6'] ?? '',
'log_rubric' => $event['7'] ?? ''
'log_user_id' => $event['3'] ?? '',
'log_user_name' => $event['4'] ?? '',
'log_text' => $event['5'] ?? '',
'log_type' => $event['6'] ?? '',
'log_rubric' => $event['7'] ?? ''
];
}
@@ -117,12 +117,12 @@
}
$_lines[] = [
'log_time' => $event['0'],
'log_ip' => $event['1'],
'log_query' => $event['2'],
'log_user_agent' => $event['3'],
'log_user_referer' => $event['4'],
'log_request_uri' => $event['5']
'log_time' => $event['0'] ?? '',
'log_ip' => $event['1'] ?? '',
'log_query' => $event['2'] ?? '',
'log_user_agent' => $event['3'] ?? '',
'log_user_referer' => $event['4'] ?? '',
'log_request_uri' => $event['5'] ?? ''
];
}
@@ -157,19 +157,21 @@
while (!feof($fp))
{
$event = fgetcsv($fp, $_slice);
// Используем разделители по умолчанию, как в оригинале, но добавим безопасное чтение.
$event = fgetcsv($fp, $_slice);
if (empty($event[0]) || count($event) < 3) {
continue;
}
$_lines[] = [
'log_time' => $event['0'],
'log_ip' => $event['1'],
'log_url' => $event['2'],
'log_user_id' => $event['3'],
'log_user_name' => $event['4'],
'log_text' => unserialize(base64_decode($event['5']))
'log_time' => $event['0'] ?? '',
'log_ip' => $event['1'] ?? '',
'log_url' => $event['2'] ?? '',
'log_user_id' => $event['3'] ?? '',
'log_user_name' => $event['4'] ?? '',
// Предполагаем, что event[5] всегда должно быть (base64_decode и unserialize)
'log_text' => isset($event['5']) ? unserialize(base64_decode($event['5'])) : ''
];
}

View File

@@ -470,7 +470,7 @@
}
/**
/**
* Удаление рубрики
*
*/
@@ -485,7 +485,10 @@
header('Location:index.php?do=rubs&cp=' . SESSION);
exit;
}
// Сначала получаем данные рубрики, которые будут использоваться для лога
$rubric_data_for_log = $this->rubricNameByIdGet($rubric_id);
$rubric_not_empty = $AVE_DB->Query("
SELECT 1
FROM
@@ -532,8 +535,14 @@
// Удалить файлы шаблонов
$this->clearTemplates($rubric_id);
// ИСПРАВЛЕНИЕ: получение названия рубрики для журнала
$rubric_title = '';
if ($rubric_data_for_log !== null && property_exists($rubric_data_for_log, 'rubric_title')) {
$rubric_title = stripslashes(htmlspecialchars($rubric_data_for_log->rubric_title, ENT_QUOTES));
}
// Сохраняем системное сообщение в журнал
reportLog($AVE_Template->get_config_vars('RUBRIK_LOG_DEL_RUBRIC') . ' - ' . stripslashes(htmlspecialchars($this->rubricNameByIdGet($rubric_id)->rubric_title, ENT_QUOTES)) . ' (id: '.$rubric_id.')');
reportLog($AVE_Template->get_config_vars('RUBRIK_LOG_DEL_RUBRIC') . ' - ' . $rubric_title . ' (id: '.$rubric_id.')');
}
header('Location:index.php?do=rubs&cp=' . SESSION);

View File

@@ -52,7 +52,7 @@
$AVE_Template->assign('field_dir', $fld_name);
$AVE_Template->assign('video', $video);
$AVE_Template->assign('rubric_id', $rubric_id);
$AVE_Template->assign('doc_id', (int)$_REQUEST['Id']);
$AVE_Template->assign('doc_id', isset($_REQUEST['Id']) ? (int)$_REQUEST['Id'] : 0);
$AVE_Template->assign('field_id', $field_id);
$AVE_Template->assign('field_value', $field_value);

View File

@@ -1,4 +1,4 @@
{if $param.4 == 'embed'}
{if isset($param.4) && $param.4 == 'embed'}
<object width="{$param.1}" height="{$param.2}">
<param name="movie" value="{$video_url}" />
@@ -9,6 +9,6 @@
{else}
<iframe width="{$param.1}" height="{$param.2}" src="{$video_url}" frameborder="0" {if $param.3 == 'true'}allowfullscreen{/if}></iframe>
<iframe width="{$param.1}" height="{$param.2}" src="{$video_url}" frameborder="0" {if isset($param.3) && $param.3 == 'true'}allowfullscreen{/if}></iframe>
{/if}