Commit 857082ce authored by Steven Wittens's avatar Steven Wittens

- Ensure word length <= 50 bytes

parent 854fa41f
......@@ -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;
......@@ -244,6 +245,13 @@ function search_keywords_split($text) {
return $words;
}
/**
* 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.
*/
......
......@@ -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;
......@@ -244,6 +245,13 @@ function search_keywords_split($text) {
return $words;
}
/**
* 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.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment