Impove tag comma parsing

This commit is contained in:
Joseph Cohen
2015-01-16 12:51:46 -06:00
parent 0fecc5dc8a
commit 54697de0a4

View File

@@ -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) {