From c0caa504a9506606bfc1a2bcc0ac4df944f45844 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Mon, 21 Apr 2025 17:27:37 +0300 Subject: [PATCH] Adding malformed json sanitation for file change events --- taskman.inc.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/taskman.inc.php b/taskman.inc.php index 2565c6f..48d9a9d 100644 --- a/taskman.inc.php +++ b/taskman.inc.php @@ -313,6 +313,8 @@ class TaskmanFileChanges { $lines = internal\_extract_lines_from_file($json_or_file); $json = '[' . implode(',', $lines) . ']'; + //NOTE: adding some sanitization for potentially malformed json + $json = str_replace(["\\", "\r\n", "\n"], ["/", "", ""], $json); } $decoded = json_decode($json, true);