Skip to content

Node.js based forum software built for the modern web

fix: regex

Barış Soner Uşaklı366a4a6d3855
diff --git a/public/src/modules/translator.common.js b/public/src/modules/translator.common.js
index 40cf494605..eb42b98d4d 100644
--- a/public/src/modules/translator.common.js
+++ b/public/src/modules/translator.common.js
@@ -12,7 +12,7 @@ module.exports = function (utils, load, warn) {
}
function validateHrefAttributes(translated) {
- return translated.replace(/href="([^"]*)"/gi, (match, href) => {
+ return translated.replace(/href\s*=\s*(["'])(.*?)\1/gi, (match, quote, href) => {
return isSafeHref(href) ? match : 'href=""';
});
}