Adding malformed json sanitation for file change events
Publish PHP Package / docker (push) Successful in 6s Details

This commit is contained in:
Pavel Shevaev 2025-04-21 17:27:37 +03:00
parent 421d6580dc
commit c0caa504a9
1 changed files with 2 additions and 0 deletions

View File

@ -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);