From 4c1f6b1f5690b9ffbf21028057af8bde7ca80bc3 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 31 Mar 2026 14:42:13 -0400 Subject: [PATCH] fix: encode nid in client-side when marking notifications read/unread --- public/src/modules/notifications.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/src/modules/notifications.js b/public/src/modules/notifications.js index 69f4bb95c4..60d48fff3c 100644 --- a/public/src/modules/notifications.js +++ b/public/src/modules/notifications.js @@ -112,7 +112,7 @@ define('notifications', [ function markNotification(nid, read, callback) { if (read) { - api.put(`/notifications/${nid}/read`).then(() => { + api.put(`/notifications/${encodeURIComponent(nid)}/read`).then(() => { if (unreadNotifs[nid]) { delete unreadNotifs[nid]; } @@ -121,7 +121,7 @@ define('notifications', [ } }).catch(alerts.error); } else { - api.del(`/notifications/${nid}/read`).then(callback).catch(alerts.error); + api.del(`/notifications/${encodeURIComponent(nid)}/read`).then(callback).catch(alerts.error); } }