From c0558ec6b8f4bac1748a289b0a0f4f790f3bedbb Mon Sep 17 00:00:00 2001 From: Lars Gebhardt-Kusche Date: Sat, 27 Dec 2025 02:49:04 +0100 Subject: [PATCH] adasd --- config/prod/settings.php | 2 +- config/staging/settings.php | 2 +- partials/structure/layout_start.php | 13 +++++++++---- public/page/debug.php | 7 +++++++ 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/config/prod/settings.php b/config/prod/settings.php index abc7963..765ef3b 100644 --- a/config/prod/settings.php +++ b/config/prod/settings.php @@ -17,5 +17,5 @@ } // Matomo Einstellungen define('MATOMO_URL', 'https://matomo.my-statistics.info/'); -define('MATOMO_ENABLED', false); +define('MATOMO_ENABLED', true); define('MATOMO_SITE_ID', 2); \ No newline at end of file diff --git a/config/staging/settings.php b/config/staging/settings.php index 9feaeee..247122a 100644 --- a/config/staging/settings.php +++ b/config/staging/settings.php @@ -18,5 +18,5 @@ } // Matomo Einstellungen define('MATOMO_URL', 'https://matomo.my-statistics.info/'); -define('MATOMO_ENABLED', false); +define('MATOMO_ENABLED', true); define('MATOMO_SITE_ID', 3); diff --git a/partials/structure/layout_start.php b/partials/structure/layout_start.php index 3da3cda..3f7611d 100644 --- a/partials/structure/layout_start.php +++ b/partials/structure/layout_start.php @@ -88,11 +88,16 @@ if ($debugEnabled) { select.addEventListener('change', ()=>{ const file = select.value; if (!file) { content.innerHTML = '

Log auswählen, um Inhalt zu sehen.

'; return; } - fetch('/debug?file=' + encodeURIComponent(file)) + fetch('/debug?file=' + encodeURIComponent(file) + '&raw=1') .then(r => r.text()) - .then(html => { - // naive extract content from /debug page: we just display raw text - content.innerHTML = '
'+html.replace(/';
+            .then(text => {
+              const escape = (s) => s
+                .replace(/&/g, '&')
+                .replace(//g, '>')
+                .replace(/"/g, '"')
+                .replace(/'/g, ''');
+              content.innerHTML = '
'+escape(text)+'
'; }) .catch(()=> content.innerHTML = '

Konnte Log nicht laden.

'); }); diff --git a/public/page/debug.php b/public/page/debug.php index b09ddbf..8176640 100644 --- a/public/page/debug.php +++ b/public/page/debug.php @@ -23,6 +23,13 @@ $content = ''; if ($selected && in_array($selected, $files, true)) { $content = @file_get_contents($base . '/' . $selected) ?: ''; } + +// Raw delivery for AJAX view (no layout, plain text) +if (isset($_GET['raw']) && $_GET['raw'] === '1') { + header('Content-Type: text/plain; charset=utf-8'); + echo $content; + exit; +} ?>