adsasd
This commit is contained in:
@@ -89,8 +89,15 @@ if ($debugEnabled) {
|
|||||||
const file = select.value;
|
const file = select.value;
|
||||||
if (!file) { content.innerHTML = '<p class="muted">Log auswählen, um Inhalt zu sehen.</p>'; return; }
|
if (!file) { content.innerHTML = '<p class="muted">Log auswählen, um Inhalt zu sehen.</p>'; return; }
|
||||||
fetch('/debug?file=' + encodeURIComponent(file) + '&raw=1')
|
fetch('/debug?file=' + encodeURIComponent(file) + '&raw=1')
|
||||||
.then(r => r.text())
|
.then(r => {
|
||||||
|
if (!r.ok) throw new Error('Request failed');
|
||||||
|
return r.text();
|
||||||
|
})
|
||||||
.then(text => {
|
.then(text => {
|
||||||
|
if (!text.trim()) {
|
||||||
|
content.innerHTML = '<p class="muted">Log ist leer.</p>';
|
||||||
|
return;
|
||||||
|
}
|
||||||
const escape = (s) => s
|
const escape = (s) => s
|
||||||
.replace(/&/g, '&')
|
.replace(/&/g, '&')
|
||||||
.replace(/</g, '<')
|
.replace(/</g, '<')
|
||||||
|
|||||||
@@ -26,6 +26,12 @@ if ($selected && in_array($selected, $files, true)) {
|
|||||||
|
|
||||||
// Raw delivery for AJAX view (no layout, plain text)
|
// Raw delivery for AJAX view (no layout, plain text)
|
||||||
if (isset($_GET['raw']) && $_GET['raw'] === '1') {
|
if (isset($_GET['raw']) && $_GET['raw'] === '1') {
|
||||||
|
if (!$selected || !in_array($selected, $files, true)) {
|
||||||
|
http_response_code(404);
|
||||||
|
header('Content-Type: text/plain; charset=utf-8');
|
||||||
|
echo 'Log nicht gefunden.';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
header('Content-Type: text/plain; charset=utf-8');
|
header('Content-Type: text/plain; charset=utf-8');
|
||||||
echo $content;
|
echo $content;
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
Reference in New Issue
Block a user