" + RSS.items[i].description + "| " + RSS.items[i].link + " | " + crawllist_body;
+ var guid = escapeHtml(RSS.items[i].guid.value);
+ var link = escapeHtml(RSS.items[i].link);
+ var description = escapeHtml(RSS.items[i].description);
+ crawllist_body = "| " + description + " | " + link + " |
" + crawllist_body;
}
doc.innerHTML = crawllist_head + crawllist_body + crawllist_tail;
}
diff --git a/htroot/js/yacyutils.js b/htroot/js/yacyutils.js
new file mode 100644
index 000000000..782de1bab
--- /dev/null
+++ b/htroot/js/yacyutils.js
@@ -0,0 +1,29 @@
+/*
+* Copyright (C) 2026 by Michael Peter Christen
+* This file is part of YaCy.
+*
+* YaCy is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 2 of the License, or
+* (at your option) any later version.
+*
+* YaCy is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with YaCy. If not, see .
+*/
+
+/*
+* Escape a string so it can be safely embedded into HTML (element text or attribute values).
+* Modeled after ServletResource.escapeHtml in source/net/yacy/http/servlets/ServletResource.java.
+* The single quote is additionally escaped so the result is safe for single-quoted attributes.
+* The ampersand must be replaced first to avoid double-encoding.
+*/
+function escapeHtml(value){
+ if (value == null) return "";
+ return String(value).replace(/&/g, "&").replace(/"/g, """)
+ .replace(//g, ">").replace(/'/g, "'");
+}
diff --git a/htroot/jslicense.html b/htroot/jslicense.html
index 8618f41c2..af3ce068d 100755
--- a/htroot/jslicense.html
+++ b/htroot/jslicense.html
@@ -203,6 +203,11 @@
GNU-GPL-2.0-or-later |
yacysort.js |
+
+ | yacyutils.js |
+ GNU-GPL-2.0-or-later |
+ yacyutils.js |
+
| yacy-portalsearch.js |
Expat |