From de0b5fa39f8859cae3e4206a5309d8fed3c1b69d Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Mon, 20 Oct 2025 10:58:58 +0200 Subject: [PATCH] Bug 41053: Move notice contents to hidden div With thanks to Jonathan for suggesting this direction. Test plan: Go to patron detail, notices tab for a patron with some notices. Look for a string that only occurs in the notice text of some notice. Without this patch, you should not find that one. With this patch, you should find it. Manipulate the text of a notice to check display of bad html. (Click title.) * Like: update message_queue set content='

test

@@ -70,7 +65,7 @@ href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber | uri %]&noticeid=[% QUEUED_MESSAGE.message_id | uri %]" >[% QUEUED_MESSAGE.subject | html %] - + [% IF ( QUEUED_MESSAGE.message_transport_type == 'email' ) %] @@ -195,7 +190,7 @@ var noticeid = $(this).data("noticeid"); // Use shadow DOM for notice content preview - var srcdoc = $("#notice" + noticeid).attr("srcdoc"); + var srcdoc = $("#notice" + noticeid).text(); var shadowHost = document.createElement("div"); var shadowRoot = shadowHost.attachShadow({ mode: "open" }); shadowRoot.innerHTML = srcdoc; -- 2.39.5