fix: "</script>" inside custom html was breaking admin-panel
Massimo Melina committed
Apr 1, 2023 at 12:24 UTC
44b073c9e3e427d3965d0dd696efb070ec38baef
1 file changed
+2
-1
src/serveGuiFiles.ts
+2
-1
@@ -106,7 +106,8 @@ async function treatIndex(ctx: Koa.Context, filesUri: string, body: string) {
106
customHtml: _.omit(Object.fromEntries(customHtmlState.sections),
107
['top','bottom']), // excluding sections we apply in this phase
108
fileMenuOnLink: fileMenuOnLink.get()
109
- }, null, 4)}
109
+ }, null, 4)
110
+ .replace(/<(\/script)/g, '<"+"$1') /*avoid breaking our script container*/}
111
document.documentElement.setAttribute('ver', '${VERSION.split('-')[0] /*for style selectors*/}')
112
</script>
113
<style>