Index: modules/taxonomy/taxonomy.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.pages.inc,v retrieving revision 1.35 diff -u -p -r1.35 taxonomy.pages.inc --- modules/taxonomy/taxonomy.pages.inc 24 Aug 2009 00:14:22 -0000 1.35 +++ modules/taxonomy/taxonomy.pages.inc 3 Sep 2009 16:38:23 -0000 @@ -92,6 +92,11 @@ function taxonomy_term_edit($term) { * Helper function for autocompletion */ function taxonomy_autocomplete_legacy($vid = 0, $tags_typed = '') { + // Were we passed just whitespace? If so, return valid but zero matches + if (preg_replace('/\S/', "", $tags_typed) == $tags_typed) { + drupal_json(array()); exit(); + } + // The user enters a comma-separated list of tags. We only autocomplete the last tag. $tags_typed = drupal_explode_tags($tags_typed); $tag_last = drupal_strtolower(array_pop($tags_typed)); @@ -144,6 +149,11 @@ function taxonomy_autocomplete_legacy($v function taxonomy_autocomplete($field_name, $bundle, $tags_typed = '') { $instance = field_info_instance($field_name, $bundle); $field = field_info_field($field_name); + + // Were we passed just whitespace? If so, return valid but zero matches + if (preg_replace('/\S/', "", $tags_typed) == $tags_typed) { + drupal_json(array()); exit(); + } // The user enters a comma-separated list of tags. We only autocomplete the last tag. $tags_typed = drupal_explode_tags($tags_typed);