1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-16 08:45:57 +00:00

format note on the client

This commit is contained in:
Andrew Dolgov
2021-02-19 17:15:22 +03:00
parent 4fa8450d38
commit d445530fa0
7 changed files with 18 additions and 38 deletions

View File

@@ -55,17 +55,14 @@ class Note extends Plugin {
}
function setNote() {
$id = $_REQUEST["id"];
$note = trim(strip_tags($_REQUEST["note"]));
$id = (int)clean($_REQUEST["id"]);
$note = clean($_REQUEST["note"]);
$sth = $this->pdo->prepare("UPDATE ttrss_user_entries SET note = ?
WHERE ref_id = ? AND owner_uid = ?");
$sth->execute([$note, $id, $_SESSION['uid']]);
$formatted_note = Article::_format_note_html($id, $note);
print json_encode(array("note" => $formatted_note,
"raw_length" => mb_strlen($note)));
print json_encode(["id" => $id, "note" => $note]);
}
function api_version() {