diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TermAutocompleteController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TermAutocompleteController.php index f14ea0e..cdd2a08 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TermAutocompleteController.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Controller/TermAutocompleteController.php @@ -13,6 +13,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\JsonResponse; +use Drupal\Component\Utility\Tags; +use Drupal\Component\Utility\Unicode; +use Drupal\Component\Utility\String; /** * Returns responses for Views UI routes. @@ -84,13 +87,13 @@ public function autocomplete(Request $request, $field_name) { if (!($field = field_info_field($field_name)) || $field['type'] !== 'taxonomy_term_reference') { // Error string. The JavaScript handler will realize this is not JSON and // will display it as debugging information. - return new Response(t('Taxonomy field @field_name not found.', array('@field_name' => $field_name))); + return new Response(t('Taxonomy field @field_name not found.', array('@field_name' => $field_name)), 403); } // 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)); + $tags_typed = Tags::explode($tags_typed); + $tag_last = Unicode::strtolower(array_pop($tags_typed)); $matches = array(); if ($tag_last != '') { @@ -125,7 +128,7 @@ public function autocomplete(Request $request, $field_name) { if (strpos($name, ',') !== FALSE || strpos($name, '"') !== FALSE) { $n = '"' . str_replace('"', '""', $name) . '"'; } - $matches[$prefix . $n] = check_plain($name); + $matches[$prefix . $n] = String::checkPlain($name); } }