summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDries Buytaert2003-05-30 14:59:22 (GMT)
committer Dries Buytaert2003-05-30 14:59:22 (GMT)
commitdcec1379aa9a0d1ef8684ba13ea8ec2a79eabbad (patch)
tree4dfb4f7f01c948a50052c572f0e2148f2d3d4064
parentfc9fd756fe563a9e9dddaf4bbc3e77503cd5cbb4 (diff)
- Fixed a warning. Patch by Jacobo Tarrio.
-rw-r--r--modules/search.module6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/search.module b/modules/search.module
index 0f7e143..e3fbb9d 100644
--- a/modules/search.module
+++ b/modules/search.module
@@ -262,8 +262,10 @@ function update_index($search_array) {
** Walk through the weighted words array, inserting them into
** the search index
*/
- foreach ($newwords as $key => $value) {
- db_query("INSERT INTO search_index VALUES('$key', ". $node["lno"] .", '$node_type', $value)");
+ if ($newwords) {
+ foreach ($newwords as $key => $value) {
+ db_query("INSERT INTO search_index VALUES('$key', ". $node["lno"] .", '$node_type', $value)");
+ }
}
// Zap the weighted words array, so we don't add multiples.