diff --git a/module/VuFind/src/VuFind/Autocomplete/Solr.php b/module/VuFind/src/VuFind/Autocomplete/Solr.php index d904e2840503..591a347f1856 100644 --- a/module/VuFind/src/VuFind/Autocomplete/Solr.php +++ b/module/VuFind/src/VuFind/Autocomplete/Solr.php @@ -30,6 +30,7 @@ namespace VuFind\Autocomplete; +use IntlChar; use function count; use function is_array; use function is_object; @@ -180,7 +181,7 @@ protected function mungeQuery($query) // Modify the query so it makes a nice, truncated autocomplete query: $forbidden = [':', '(', ')', '*', '+', '"', "'"]; $query = str_replace($forbidden, ' ', $query); - if (!str_ends_with($query, ' ')) { + if (IntlChar::isalpha(substr($query, -1))) { $query .= '*'; } return $query;