diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/search.module | 8 | ||||
-rw-r--r-- | modules/search/search.module | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/modules/search.module b/modules/search.module index d8586d5db..0d3fca652 100644 --- a/modules/search.module +++ b/modules/search.module @@ -236,6 +236,7 @@ function search_keywords_split($text) { // Process words $words = explode(' ', $text); + array_walk($words, '_search_keywords_truncate'); // Save last keyword result $last = $text; @@ -245,6 +246,13 @@ function search_keywords_split($text) { } /** + * Helper function for array_walk in search_keywords_split. + */ +function _search_keywords_truncate(&$text) { + $text = truncate_utf8($text, 3); +} + +/** * Invokes hook_search_preprocess() in modules. */ function search_preprocess(&$text) { diff --git a/modules/search/search.module b/modules/search/search.module index d8586d5db..0d3fca652 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -236,6 +236,7 @@ function search_keywords_split($text) { // Process words $words = explode(' ', $text); + array_walk($words, '_search_keywords_truncate'); // Save last keyword result $last = $text; @@ -245,6 +246,13 @@ function search_keywords_split($text) { } /** + * Helper function for array_walk in search_keywords_split. + */ +function _search_keywords_truncate(&$text) { + $text = truncate_utf8($text, 3); +} + +/** * Invokes hook_search_preprocess() in modules. */ function search_preprocess(&$text) { |