From 54697de0a4aa26ca9ee8764bbd2db5f5a329ed6e Mon Sep 17 00:00:00 2001 From: Joseph Cohen Date: Fri, 16 Jan 2015 12:51:46 -0600 Subject: [PATCH] Impove tag comma parsing --- src/Http/Controllers/DashComponentController.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Http/Controllers/DashComponentController.php b/src/Http/Controllers/DashComponentController.php index bb70d950..ae8c951f 100644 --- a/src/Http/Controllers/DashComponentController.php +++ b/src/Http/Controllers/DashComponentController.php @@ -119,8 +119,7 @@ class DashComponentController extends Controller } // The component was added successfully, so now let's deal with the tags. - $tags = str_replace(', ', ',', $tags); // Clean up. - $tags = explode(',', $tags); + $tags = preg_split('/ ?, ?/', $tags); // For every tag, do we need to create it? $componentTags = array_map(function ($taggable) use ($component) { @@ -179,8 +178,7 @@ class DashComponentController extends Controller } // The component was added successfully, so now let's deal with the tags. - $tags = str_replace(', ', ',', $tags); // Clean up. - $tags = explode(',', $tags); + $tags = preg_split('/ ?, ?/', $tags); // For every tag, do we need to create it? $componentTags = array_map(function ($taggable) use ($component) {