summaryrefslogtreecommitdiff
path: root/modules/tag/controllers
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-07-28 04:54:20 +0800
committerTim Almdal <tnalmdal@shaw.ca>2009-07-28 06:28:31 +0800
commitecc9203c2352bdfa3738998f27268293345ec0e9 (patch)
tree94d28284c49fd12d9e9b8fd50f0885a7195f7b59 /modules/tag/controllers
parent7efb4b4cdfba4c0280b18d1980cd8ad011360b87 (diff)
Standardize the specification of tags.
With this patch a comma(,) is the only valid tag separator. Spaces are allowed in tags and phrases no longer need to be specified with a dot. Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
Diffstat (limited to 'modules/tag/controllers')
-rw-r--r--modules/tag/controllers/tags.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/tag/controllers/tags.php b/modules/tag/controllers/tags.php
index a600ea1a..69178925 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, str_replace(" ", ".", $tag_name));
+ $tag = tag::add($item, $tag_name);
}
}
@@ -81,7 +81,7 @@ class Tags_Controller extends REST_Controller {
public function autocomplete() {
$tags = array();
- $tag_parts = preg_split("#[,\s;]+# ", $this->input->get("q"));
+ $tag_parts = preg_split("#[,\s]+# ", $this->input->get("q"));
$limit = $this->input->get("limit");
$tag_part = end($tag_parts);
$tag_list = ORM::factory("tag")