0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-28 11:22:39 +00:00

Added additional tests for injection

This commit is contained in:
Trevor Buckner
2024-05-03 17:02:12 -04:00
parent f6997871be
commit dce86580ce
2 changed files with 79 additions and 4 deletions

View File

@@ -754,7 +754,7 @@ const extractHTMLStyleTags = (htmlString)=> {
const id = htmlString.match(/id="([^"]*)"/)?.[1] || null;
const classes = htmlString.match(/class="([^"]*)"/)?.[1] || null;
const styles = htmlString.match(/style="([^"]*)"/)?.[1] || null;
const attributes = htmlString.match(/([a-z]+="[^"]*)"/g)
const attributes = htmlString.match(/[a-zA-Z]+="[^"]*"/g)
?.filter(attr => !attr.startsWith('class="') && !attr.startsWith('style="') && !attr.startsWith('id="'))
.reduce((obj, attr) => {
let [key, value] = attr.split("=");