Commit cd632f62 authored by Dries's avatar Dries

- Alternative fix for search module bug.

parent 4c630e8f
......@@ -279,7 +279,7 @@ function update_index($search_array) {
// Walk through the array, giving a "weight" to each word based on
// the number of times it appears in a page.
foreach ($eachword as $word) {
if (strlen($word) >= $minimum_word_size) {
if (strlen($word) >= $minimum_word_size && strlen($word) <= 50) {
if ($newwords[$word]) {
$newwords[$word]++;
}
......@@ -293,9 +293,7 @@ function update_index($search_array) {
// the search index.
if ($newwords) {
foreach ($newwords as $key => $value) {
if (strlen($key) <= 50) {
db_query("INSERT INTO {search_index} VALUES('%s', %d, '%s', %d)", $key, $node['lno'], $node_type, $value);
}
db_query("INSERT INTO {search_index} VALUES('%s', %d, '%s', %d)", $key, $node['lno'], $node_type, $value);
}
}
......
......@@ -279,7 +279,7 @@ function update_index($search_array) {
// Walk through the array, giving a "weight" to each word based on
// the number of times it appears in a page.
foreach ($eachword as $word) {
if (strlen($word) >= $minimum_word_size) {
if (strlen($word) >= $minimum_word_size && strlen($word) <= 50) {
if ($newwords[$word]) {
$newwords[$word]++;
}
......@@ -293,9 +293,7 @@ function update_index($search_array) {
// the search index.
if ($newwords) {
foreach ($newwords as $key => $value) {
if (strlen($key) <= 50) {
db_query("INSERT INTO {search_index} VALUES('%s', %d, '%s', %d)", $key, $node['lno'], $node_type, $value);
}
db_query("INSERT INTO {search_index} VALUES('%s', %d, '%s', %d)", $key, $node['lno'], $node_type, $value);
}
}
......
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