diff --git a/htroot/Crawler_p.html b/htroot/Crawler_p.html index 4a4adc8f6..935999461 100644 --- a/htroot/Crawler_p.html +++ b/htroot/Crawler_p.html @@ -6,6 +6,7 @@ + diff --git a/htroot/js/Crawler.js b/htroot/js/Crawler.js index 3e840ac23..54a3963dc 100644 --- a/htroot/js/Crawler.js +++ b/htroot/js/Crawler.js @@ -411,7 +411,10 @@ function showRSS(RSS) { if (doc != null) { if (crawllist_body.length > 100000) crawllist_body = ""; for (var i=0; i" + 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