Skip to content

Node.js based forum software built for the modern web

templates - don't clean up selector conditionals; fixes topic posting bug introduced at 090d35f306bd8d471ab347d8f524afdb1bc244c3

psychobunnyf1ad4698613d
diff --git a/public/src/templates.js b/public/src/templates.js
index 51dfd0dc65..2516efb342 100644
--- a/public/src/templates.js
+++ b/public/src/templates.js
@@ -320,16 +320,16 @@
if (conditionalBlock[1]) {
// there is an else statement
if (!value) {
- template = template.replace(matches[i], conditionalBlock[1].replace(/<!-- ((\IF\b)|(\bENDIF\b))(.*?)-->/gi, ''));
+ template = template.replace(matches[i], conditionalBlock[1].replace(/<!-- ((\IF\b)|(\bENDIF\b))([^@]*?)-->/gi, ''));
} else {
- template = template.replace(matches[i], conditionalBlock[0].replace(/<!-- ((\IF\b)|(\bENDIF\b))(.*?)-->/gi, ''));
+ template = template.replace(matches[i], conditionalBlock[0].replace(/<!-- ((\IF\b)|(\bENDIF\b))([^@]*?)-->/gi, ''));
}
} else {
// regular if statement
if (!value) {
template = template.replace(matches[i], '');
} else {
- template = template.replace(matches[i], matches[i].replace(/<!-- ((\IF\b)|(\bENDIF\b))(.*?)-->/gi, ''));
+ template = template.replace(matches[i], matches[i].replace(/<!-- ((\IF\b)|(\bENDIF\b))([^@]*?)-->/gi, ''));
}
}
}