diff options
author | Andy Staudacher <andy.st@gmail.com> | 2010-02-06 13:05:44 -0800 |
---|---|---|
committer | Andy Staudacher <andy.st@gmail.com> | 2010-02-06 13:05:44 -0800 |
commit | 7099fc71f11ef8d3dd613d96a04a4824a827c714 (patch) | |
tree | 56a0cdde8af26c66b27095f15107294c9c75a52c /modules/tag/controllers | |
parent | 5c0c33782d7dd3556adecb9593f25f2cff06401a (diff) |
Fix for ticket 1004: Replace all uses of split with explode (none actually required regular expressions). Thanks to Brian Hartsock for providing a patch!
Diffstat (limited to 'modules/tag/controllers')
-rw-r--r-- | modules/tag/controllers/tags.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/tag/controllers/tags.php b/modules/tag/controllers/tags.php index 1eede907..04400d73 100644 --- a/modules/tag/controllers/tags.php +++ b/modules/tag/controllers/tags.php @@ -60,7 +60,7 @@ class Tags_Controller extends Controller { $form = tag::get_add_form($item); if ($form->validate()) { - foreach (split(",", $form->add_tag->inputs["name"]->value) as $tag_name) { + foreach (explode(",", $form->add_tag->inputs["name"]->value) as $tag_name) { $tag_name = trim($tag_name); if ($tag_name) { $tag = tag::add($item, $tag_name); @@ -77,9 +77,9 @@ class Tags_Controller extends Controller { public function autocomplete() { $tags = array(); - $tag_parts = preg_split("#,#", Input::instance()->get("q")); + $tag_parts = explode(",", Input::instance()->get("q")); $limit = Input::instance()->get("limit"); - $tag_part = end($tag_parts); + $tag_part = ltrim(end($tag_parts)); $tag_list = ORM::factory("tag") ->where("name", "LIKE", "{$tag_part}%") ->order_by("name", "ASC") |