summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-07-23 09:26:04 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-07-23 09:26:04 -0700
commitfa0c17ab5be2724b7fa850f2077afe7e69d6ef4d (patch)
treec2bdfb80e4fb2a583b603f0bf13b28e92249ddd4
parent5999ccb512d65ad9ae06a0a5542eb1123b44e9db (diff)
Make tag handling consistent by converting spaces to periods and using commas or semi-colons as separators
-rw-r--r--modules/tag/controllers/tags.php4
-rw-r--r--modules/tag/helpers/tag_event.php2
2 files changed, 3 insertions, 3 deletions
diff --git a/modules/tag/controllers/tags.php b/modules/tag/controllers/tags.php
index 85f6d16e..5dd07935 100644
--- a/modules/tag/controllers/tags.php
+++ b/modules/tag/controllers/tags.php
@@ -53,10 +53,10 @@ class Tags_Controller extends REST_Controller {
$form = tag::get_add_form($item);
if ($form->validate()) {
- foreach (split("[\,\ \;]", $form->add_tag->inputs["name"]->value) as $tag_name) {
+ 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);
+ $tag = tag::add($item, str_replace(" ", ".", $tag_name));
}
}
diff --git a/modules/tag/helpers/tag_event.php b/modules/tag/helpers/tag_event.php
index d13d1340..e1ab1b73 100644
--- a/modules/tag/helpers/tag_event.php
+++ b/modules/tag/helpers/tag_event.php
@@ -74,7 +74,7 @@ class tag_event_Core {
tag::clear_all($item);
foreach (preg_split("/[,;]/", $form->edit_item->tags->value) as $tag_name) {
if ($tag_name) {
- tag::add($item, $tag_name);
+ tag::add($item, str_replace(" ", ".", $tag_name));
}
}
tag::compact();