summaryrefslogtreecommitdiff
path: root/modules/tag/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'modules/tag/controllers')
-rw-r--r--modules/tag/controllers/tags.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/tag/controllers/tags.php b/modules/tag/controllers/tags.php
index 515ddd59..ad401fdb 100644
--- a/modules/tag/controllers/tags.php
+++ b/modules/tag/controllers/tags.php
@@ -52,7 +52,12 @@ class Tags_Controller extends REST_Controller {
$form = tag::get_add_form($item);
if ($form->validate()) {
- tag::add($item, $form->add_tag->inputs["name"]->value);
+ foreach (split("[\,\ \;]", $form->add_tag->inputs["name"]->value) as $tag_name) {
+ $tag_name = trim($tag_name);
+ if ($tag_name) {
+ $tag = tag::add($item, $tag_name);
+ }
+ }
print json_encode(
array("result" => "success",