- Ensure word length <= 50 bytes
parent
854fa41fb3
commit
857082ce7e
|
@ -236,6 +236,7 @@ function search_keywords_split($text) {
|
||||||
|
|
||||||
// Process words
|
// Process words
|
||||||
$words = explode(' ', $text);
|
$words = explode(' ', $text);
|
||||||
|
array_walk($words, '_search_keywords_truncate');
|
||||||
|
|
||||||
// Save last keyword result
|
// Save last keyword result
|
||||||
$last = $text;
|
$last = $text;
|
||||||
|
@ -244,6 +245,13 @@ function search_keywords_split($text) {
|
||||||
return $words;
|
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.
|
* Invokes hook_search_preprocess() in modules.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -236,6 +236,7 @@ function search_keywords_split($text) {
|
||||||
|
|
||||||
// Process words
|
// Process words
|
||||||
$words = explode(' ', $text);
|
$words = explode(' ', $text);
|
||||||
|
array_walk($words, '_search_keywords_truncate');
|
||||||
|
|
||||||
// Save last keyword result
|
// Save last keyword result
|
||||||
$last = $text;
|
$last = $text;
|
||||||
|
@ -244,6 +245,13 @@ function search_keywords_split($text) {
|
||||||
return $words;
|
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.
|
* Invokes hook_search_preprocess() in modules.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue