diff --git a/core/misc/ajax.js b/core/misc/ajax.js
index 252e0db24d1e6889318ec21fcdf906db9ee938af..166242a37863b74e2024f4f4f9e76660591ab345 100644
--- a/core/misc/ajax.js
+++ b/core/misc/ajax.js
@@ -1341,7 +1341,7 @@
         const tempDiv = fragment.appendChild(document.createElement('div'));
 
         // Set the innerHTML of the div to the provided HTML string
-        tempDiv.innerHTML = htmlString;
+        tempDiv.setHTMLUnsafe(htmlString);
 
         // Return the contents of the temporary div
         return tempDiv.childNodes;