From b392aa4a4a7a968f1de5956f5c98727856fb7637 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 28 Jun 2016 09:39:55 -0400 Subject: [PATCH] Fixes #45: Strip plus signs during slugification --- netbox/project-static/js/forms.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox/project-static/js/forms.js b/netbox/project-static/js/forms.js index 793a7c8e2..4ba61f13a 100644 --- a/netbox/project-static/js/forms.js +++ b/netbox/project-static/js/forms.js @@ -7,9 +7,9 @@ $(document).ready(function() { // Slugify function slugify(s, num_chars) { - s = s.replace(/[^-\.\+\w\s]/g, ''); // Remove unneeded chars + s = s.replace(/[^\-\.\w\s]/g, ''); // Remove unneeded chars s = s.replace(/^\s+|\s+$/g, ''); // Trim leading/trailing spaces - s = s.replace(/[-\s]+/g, '-'); // Convert spaces to hyphens + s = s.replace(/[\-\.\s]+/g, '-'); // Convert spaces and decimals to hyphens s = s.toLowerCase(); // Convert to lowercase return s.substring(0, num_chars); // Trim to first num_chars chars }