0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 16:22:44 +00:00

Remove type='submit' attribute

This commit is contained in:
G.Ambatte
2024-10-29 18:10:25 +13:00
parent 4673303bc2
commit f5bc490380

View File

@@ -20,6 +20,7 @@ function safeHTML(htmlString) {
// Tests to remove attributes
const blacklistAttrs = [
(test)=>{return test.localName.indexOf('on') == 0;},
(test)=>{return test.localName.indexOf('type') == 0 && test.value.match(/submit/i);},
(test)=>{return test.value.replace(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g, '').toLowerCase().trim().indexOf('javascript:') == 0;}
];