Browse Source

Also escape `"` and `'` just in case

kellda 4 năm trước cách đây
mục cha
commit
fac35dca03
1 tập tin đã thay đổi với 6 bổ sung2 xóa
  1. 6 2
      src/notification_listing.rs

+ 6 - 2
src/notification_listing.rs

@@ -30,7 +30,9 @@ pub async fn render(db: &DbClient, user: &str) -> String {
                 .unwrap_or(&notification.origin_url)
                 .replace('&', "&")
                 .replace('<', "&lt;")
-                .replace('>', "&gt;"),
+                .replace('>', "&gt;")
+                .replace('"', "&quot;")
+                .replace('\'', "&#39;"),
         ));
         if let Some(metadata) = &notification.metadata {
             out.push_str(&format!(
@@ -38,7 +40,9 @@ pub async fn render(db: &DbClient, user: &str) -> String {
                 metadata
                     .replace('&', "&amp;")
                     .replace('<', "&lt;")
-                    .replace('>', "&gt;"),
+                    .replace('>', "&gt;")
+                    .replace('"', "&quot;")
+                    .replace('\'', "&#39;"),
             ));
         }
         out.push_str("</li>");