diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2013-02-23 01:09:30 -0500 |
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2013-02-23 01:09:30 -0500 |
| commit | 9d6ed037bb5b346fba900c17ba57b34dae3b6fc8 (patch) | |
| tree | 2caddad82bfa6a6ad5f45ea0199c2d0539278026 /modules/tag/controllers | |
| parent | 42878556cf38bccfea2b9b38ab2c8dd90d1ebc88 (diff) | |
| parent | f95159c0b886a2ff724d6fa9a9315460186b02ef (diff) | |
Merge branch 'jquery_190'
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)); } } |
