Skip to content

fix: prevent crash on system log page when log line has no pipe separator#6489

Merged
gharlan merged 2 commits intoredaxo:5.xfrom
tyrant88:tyrant88-patch-248
May 8, 2026
Merged

fix: prevent crash on system log page when log line has no pipe separator#6489
gharlan merged 2 commits intoredaxo:5.xfrom
tyrant88:tyrant88-patch-248

Conversation

@tyrant88
Copy link
Copy Markdown
Contributor

@tyrant88 tyrant88 commented May 2, 2026

Wenn eine Zeile im system.log kein Pipe "|"-Trenner enthält, liefert rex_log_entry::createFromString() ein leeres "data"-Array.
Beim Aufruf der System-Log-Page wird dann eine Exception geworfen, weil $data[0] undefined also "null" ist.

InvalidArgumentException: Exptected a string, but got null
redaxo/src/core/lib/util/type.php:218

Fix: Null-Coalesce auf '' für "$data[0]" und "$data[1]".

Ich konnte zwar nicht mehr ermitteln, wie das passierte, denke aber sinnvoll ist es anyway.

tyrant88 and others added 2 commits May 2, 2026 17:39
Wenn eine Zeile in `system.log` keinen ` |`-Trenner enthält, liefert
`rex_log_entry::createFromString()` ein leeres `data`-Array. Beim Aufruf
der System-Log-Page in `redaxo/src/core/pages/system.log.redaxo.php:53`
fliegt dann eine `InvalidArgumentException`, weil `$data[0]` undefined →
`null` ist und `rex_type::string(null)` direkt aussteigt:

> InvalidArgumentException: Exptected a string, but got null
> redaxo/src/core/lib/util/type.php:218

Folge: die System-Log-Page selbst lässt sich nicht mehr öffnen, was die
Diagnose erschwert (genau die Page, die man jetzt bräuchte, ist tot).

Aufgetreten auf einer produktiven REDAXO-5.21-Installation; im Log
steht erst die Warning ("Undefined array key 0", `system.log.redaxo.php:53`),
beim nächsten Aufruf dann die Fatal Exception.

Fix: Null-Coalesce auf '' für `$data[0]` und `$data[1]`, damit auch
malformierte Logzeilen sauber gerendert werden (mit leerem Type/Message).
@gharlan gharlan changed the title System-Log: Whoops vermeiden bei Logzeile ohne Pipe-Separator fix: prevent crash on system log page when log line has no pipe separator May 8, 2026
@rex-bot rex-bot added the bug label May 8, 2026
@gharlan gharlan added this to the REDAXO 5.21.1 milestone May 8, 2026
@gharlan gharlan merged commit 2ced10b into redaxo:5.x May 8, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants