Commit 52d4e537 authored by Susanne Moog's avatar Susanne Moog Committed by Benni Mack
Browse files

[BUGFIX] Avoid type errors in TimeTracker

Make sure to pass strings to html formatting methods.
Initialize hierarchy array correctly.

Resolves: #96448
Releases: main, 11.5
Change-Id: I2b9c28303c1c96d0a2ea1bc3ca971da3b4b3fe7d
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72838


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent cd6df0df
......@@ -456,17 +456,17 @@ class TimeTracker implements SingletonInterface
$keyValue = $data['value'];
$item .= '<td class="' . $logRowClass . ' typo3-adminPanel-tsLogTime">' . $this->fw(htmlspecialchars($keyValue)) . '</td>';
if ($this->printConf['allTime']) {
$item .= '<td class="' . $logRowClass . ' typo3-adminPanel-tsLogTime"> ' . $this->fw($data['starttime']) . '</td>';
$item .= '<td class="' . $logRowClass . ' typo3-adminPanel-tsLogTime"> ' . $this->fw($data['owntime']) . '</td>';
$item .= '<td class="' . $logRowClass . ' typo3-adminPanel-tsLogTime"> ' . $this->fw((string)$data['starttime']) . '</td>';
$item .= '<td class="' . $logRowClass . ' typo3-adminPanel-tsLogTime"> ' . $this->fw((string)$data['owntime']) . '</td>';
$item .= '<td class="' . $logRowClass . ' typo3-adminPanel-tsLogTime"> ' . $this->fw(($data['subtime'] ? '+' . $data['subtime'] : '')) . '</td>';
$item .= '<td class="' . $logRowClass . ' typo3-adminPanel-tsLogTime"> ' . $this->fw(($data['subtime'] ? '=' . $data['deltatime'] : '')) . '</td>';
} else {
$item .= '<td class="' . $logRowClass . ' typo3-adminPanel-tsLogTime"> ' . $this->fw($data['owntime']) . '</td>';
$item .= '<td class="' . $logRowClass . ' typo3-adminPanel-tsLogTime"> ' . $this->fw((string)$data['owntime']) . '</td>';
}
// Messages:
$msgArr = [];
$msg = '';
if ($flag_messages && is_array($data['message'])) {
if ($flag_messages && is_array($data['message'] ?? null)) {
foreach ($data['message'] as $v) {
$msgArr[] = nl2br($v);
}
......@@ -607,6 +607,9 @@ class TimeTracker implements SingletonInterface
if ($pointer > 0) {
end($arr);
$k = key($arr);
if (!is_array($arr[(int)$k . '.'] ?? null)) {
$arr[(int)$k . '.'] = [];
}
$this->createHierarchyArray($arr[(int)$k . '.'], $pointer - 1, $uniqueId);
} else {
$arr[] = $uniqueId;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment