diff options
author | Andrew Dolgov <[email protected]> | 2023-10-24 21:35:48 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2023-10-24 21:35:48 +0300 |
commit | ed43a7336925c1a97cad8768afa52c5c46f299bb (patch) | |
tree | 62690b3569844319ef28077d49ef5bf4c9f4d1ab /classes | |
parent | e31636bf9748fcf5914ed96db9d001bd02e301f3 (diff) |
api: escape newlines in headline content HTML object
Diffstat (limited to 'classes')
-rwxr-xr-x | classes/api.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/classes/api.php b/classes/api.php index 3a3ae0e63..3af747644 100755 --- a/classes/api.php +++ b/classes/api.php @@ -815,7 +815,6 @@ class API extends Handler { $headline_row["excerpt"] = $line["content_preview"]; if ($show_content) { - if ($sanitize_content) { $headline_row["content"] = Sanitizer::sanitize( $line["content"], @@ -868,6 +867,8 @@ class API extends Handler { $hook_object); $headline_row["content"] = DiskCache::rewrite_urls($headline_row['content']); + $headline_row["content"] = str_replace(["\r", "\n"], ["\\r", "\\n"], $headline_row["content"]); + } array_push($headlines, $headline_row); |