summaryrefslogtreecommitdiff
path: root/modules/taxonomy/taxonomy.module
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2007-06-22 08:46:16 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2007-06-22 08:46:16 +0000
commit569ede574f2db14d7359b42e1ccbf5772a4554fb (patch)
treefadd967fb5610aacf078b562a29f5728f23a710d /modules/taxonomy/taxonomy.module
parentfe8b35f52778b63b96c969da27d2929beee8c1b9 (diff)
downloadbrdo-569ede574f2db14d7359b42e1ccbf5772a4554fb.tar.gz
brdo-569ede574f2db14d7359b42e1ccbf5772a4554fb.tar.bz2
#115139: Add centralized json handler (and send text/javascript content-type header).
Diffstat (limited to 'modules/taxonomy/taxonomy.module')
-rw-r--r--modules/taxonomy/taxonomy.module6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index 17e169f8c..adc722559 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -1506,12 +1506,12 @@ function taxonomy_autocomplete($vid, $string = '') {
// Fetch last tag
$last_string = trim(array_pop($array));
+ $matches = array();
if ($last_string != '') {
$result = db_query_range(db_rewrite_sql("SELECT t.tid, t.name FROM {term_data} t WHERE t.vid = %d AND LOWER(t.name) LIKE LOWER('%%%s%%')", 't', 'tid'), $vid, $last_string, 0, 10);
$prefix = count($array) ? implode(', ', $array) .', ' : '';
- $matches = array();
while ($tag = db_fetch_object($result)) {
$n = $tag->name;
// Commas and quotes in terms are special cases, so encode 'em.
@@ -1520,9 +1520,9 @@ function taxonomy_autocomplete($vid, $string = '') {
}
$matches[$prefix . $n] = check_plain($tag->name);
}
- print drupal_to_js($matches);
- exit();
}
+
+ drupal_json($matches);
}
/**