From c5d2b8dc238d93e9269ad732424fa7662c0a6330 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 25 Mar 2013 17:17:11 +0000 Subject: [PATCH] Fix category check matching numbers inside other class names --- etemplate/js/et2_extension_nextmatch_rowProvider.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etemplate/js/et2_extension_nextmatch_rowProvider.js b/etemplate/js/et2_extension_nextmatch_rowProvider.js index 8c25b08d1c..c38ace15fa 100644 --- a/etemplate/js/et2_extension_nextmatch_rowProvider.js +++ b/etemplate/js/et2_extension_nextmatch_rowProvider.js @@ -461,9 +461,9 @@ var et2_nextmatch_rowProvider = Class.extend({ if(category_location) category_location = category_location[0]; // Get actual categories, eg. "cat_15" or "123,456,789", make sure to not match numbers inside other class-names - cats = classes.match(/(^| |,|cat_)?([0-9]+)( |,|$)/g); + cats = classes.match(/(^| |,|cat_)([0-9]+)( |,|$)/g); if (!cats) cats = []; - classes = classes.replace(/(^| |,|cat_)?([0-9]+)( |,|$)/g, ''); + classes = classes.replace(/(^| |,|cat_)([0-9]+)( |,|$)/g, ''); // Get category info if(!this.categories) @@ -481,7 +481,7 @@ var et2_nextmatch_rowProvider = Class.extend({ { // Need cat_, classes can't start with a number var cat_id = cats[i]; - cat_id = cat_id.replace(/[^0-9]/, ''); + cat_id = cat_id.replace(/[^0-9]/g, ''); var cat_class = 'cat_'+cat_id; // Check for existing class