mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-10 03:27:57 +00:00
refac: apply DOMPurify to excel and office HTML render assignments (#24468)
This commit is contained in:
parent
7eeff2fdf9
commit
3746339cfc
2 changed files with 5 additions and 3 deletions
|
|
@ -455,7 +455,8 @@
|
|||
selectedExcelSheet = excelSheetNames[0];
|
||||
const { excelToTable } = await import('$lib/utils/excelToTable');
|
||||
const result = await excelToTable(wb.Sheets[selectedExcelSheet]);
|
||||
fileOfficeHtml = result.html;
|
||||
const DOMPurify = (await import('dompurify')).default;
|
||||
fileOfficeHtml = DOMPurify.sanitize(result.html);
|
||||
}
|
||||
} else if (ext === 'pptx') {
|
||||
const { pptxToImages } = await import('$lib/utils/pptxToHtml');
|
||||
|
|
@ -1282,7 +1283,8 @@
|
|||
selectedExcelSheet = sheet;
|
||||
const { excelToTable } = await import('$lib/utils/excelToTable');
|
||||
const result = await excelToTable(excelWorkbook.Sheets[sheet]);
|
||||
fileOfficeHtml = result.html;
|
||||
const DOMPurify = (await import('dompurify')).default;
|
||||
fileOfficeHtml = DOMPurify.sanitize(result.html);
|
||||
}}
|
||||
baseUrl={selectedTerminal?.url ?? ''}
|
||||
apiKey={selectedTerminal?.key ?? ''}
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@
|
|||
const { excelToTable } = await import('$lib/utils/excelToTable');
|
||||
const worksheet = excelWorkbook.Sheets[selectedSheet];
|
||||
const result = await excelToTable(worksheet);
|
||||
excelHtml = result.html;
|
||||
excelHtml = DOMPurify.sanitize(result.html);
|
||||
rowCount = result.rowCount;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue