From 4fc3115f335208a6188b46e686cf0f250442d264 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 30 Nov 2017 15:22:33 -0500 Subject: [PATCH] disallow underscore in slugs (#6133) --- public/src/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/src/utils.js b/public/src/utils.js index 0e300d2772..37eb821c83 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,