Skip to content

Node.js based forum software built for the modern web

Revert "disallow underscore in slugs (#6133)"

Barış Soner Uşaklıfaded26dea22
diff --git a/public/src/utils.js b/public/src/utils.js
index 37eb821c83..0e300d2772 100644
--- a/public/src/utils.js
+++ b/public/src/utils.js
@@ -336,8 +336,8 @@
return String(str).replace(new RegExp('<(\\/)?(' + (pattern || '[^\\s>]+') + ')(\\s+[^<>]*?)?\\s*(\\/)?>', 'gi'), '');
},
- invalidUnicodeChars: XRegExp('([^\\p{L}\\s\\d-]|_)', 'g'),
- invalidLatinChars: /([^\w\s\d-]|_)/g,
+ invalidUnicodeChars: XRegExp('[^\\p{L}\\s\\d\\-_]', 'g'),
+ invalidLatinChars: /[^\w\s\d\-_]/g,
trimRegex: /^\s+|\s+$/g,
collapseWhitespace: /\s+/g,
collapseDash: /-+/g,