mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-11-30 12:14:36 -05:00
getStat() built each cell of the event details table as an HTML string and set it with .html(), so a Name, Cause or Notes holding markup was rendered as markup instead of shown as its text, both on page load and after each stream status reply (ajax/status.php returns them as stored). Escape the event's values with escapeHTML() before they join the cell's own markup; the monitor name, storage name and path the same way, and encode the path in the files link. event.js.php wrote the Cause into a single-quoted JS string through validHtmlStr(), which escapes quotes but not backslashes: a Cause ending in a backslash broke the view's script, and a backslash before a newline was dropped. Hand it over with json_encode() as Name and Notes already are; getStat() escapes it now, so the value is no longer pre-escaped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>