diff options
| author | Nathan Kinkade <nath@nkinka.de> | 2013-03-19 16:41:42 +0000 |
|---|---|---|
| committer | Nathan Kinkade <nath@nkinka.de> | 2013-03-19 16:41:42 +0000 |
| commit | 3908e37d965fa76ea774e76ddf42365a872a5f27 (patch) | |
| tree | 457e1a1e465f83855eee96ba287cd91f1623395c /modules/tag/controllers | |
| parent | 711651f727e093cc7357a6bbff6bd992fd6dfd80 (diff) | |
| parent | 1eab94f6062b5f54ea5d9db01d968e7195f3de9d (diff) | |
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/tag/controllers')
| -rw-r--r-- | modules/tag/controllers/tags.php | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/tag/controllers/tags.php b/modules/tag/controllers/tags.php index 77d45a95..32e857c6 100644 --- a/modules/tag/controllers/tags.php +++ b/modules/tag/controllers/tags.php @@ -48,18 +48,17 @@ class Tags_Controller extends Controller { public function autocomplete() { $tags = array(); - $tag_parts = explode(",", Input::instance()->get("q")); - $limit = Input::instance()->get("limit"); + $tag_parts = explode(",", Input::instance()->get("term")); $tag_part = ltrim(end($tag_parts)); $tag_list = ORM::factory("tag") ->where("name", "LIKE", Database::escape_for_like($tag_part) . "%") ->order_by("name", "ASC") - ->limit($limit) + ->limit(100) ->find_all(); foreach ($tag_list as $tag) { - $tags[] = html::clean($tag->name); + $tags[] = (string)html::clean($tag->name); } - ajax::response(implode("\n", $tags)); + ajax::response(json_encode($tags)); } } |
