summaryrefslogtreecommitdiff
path: root/modules/search.module
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2005-07-25 20:40:35 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2005-07-25 20:40:35 +0000
commit11a4aba9a63c82b0bb7805b50b8a761cc5a9c493 (patch)
tree92719121fa484fd1efc4160909f67195766c389a /modules/search.module
parentdd2c5765999125bf37dd25b4e0a88cce77043a55 (diff)
downloadbrdo-11a4aba9a63c82b0bb7805b50b8a761cc5a9c493.tar.gz
brdo-11a4aba9a63c82b0bb7805b50b8a761cc5a9c493.tar.bz2
- #26688: Add mbstring support to Drupal and clear up string handling fuzzies.
Diffstat (limited to 'modules/search.module')
-rw-r--r--modules/search.module12
1 files changed, 5 insertions, 7 deletions
diff --git a/modules/search.module b/modules/search.module
index d366f795e..9670483e4 100644
--- a/modules/search.module
+++ b/modules/search.module
@@ -357,7 +357,7 @@ function search_index($sid, $type, $text) {
if ($tag) {
// Increase or decrease score per word based on tag
list($tagname) = explode(' ', $value, 2);
- $tagname = strtolower($tagname);
+ $tagname = drupal_strtolower($tagname);
if ($tagname{0} == '/') {
$score -= $tags[substr($tagname, 1)];
if ($score < 1) { // possible due to bad HTML
@@ -389,9 +389,8 @@ function search_index($sid, $type, $text) {
$words = search_keywords_split($value);
foreach ($words as $word) {
// Check wordlength
- if (string_length($word) >= $minimum_word_size) {
- // Note: strtolower can be used because the value is only used internally.
- $word = strtolower($word);
+ if (drupal_strlen($word) >= $minimum_word_size) {
+ $word = drupal_strtolower($word);
if ($link) {
if (!isset($results[$linknid])) {
$results[$linknid] = array();
@@ -484,13 +483,12 @@ function do_search($keywords, $type, $join = '', $where = '1', $variation = true
continue;
}
if (strpos($word, '�') !== false) {
- // Note: strtolower can be used because the value is only used internally.
$words[] = "i.word LIKE '%s'";
- $arguments[] = str_replace('�', '%', strtolower($word));
+ $arguments[] = str_replace('�', '%', drupal_strtolower($word));
}
else {
$words[] = "i.word = '%s'";
- $arguments[] = strtolower($word);
+ $arguments[] = drupal_strtolower($word);
}
}
// Tell the user which words were excluded