diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-05-30 14:58:44 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-05-30 14:58:44 +0000 |
commit | 2aa762436fd74688be242d64a90306ecfd0d8562 (patch) | |
tree | 6d2ebd08000d935ae2229a2fefdbe6a71535a02b | |
parent | adc5ab2f5a596ed9861abb63e87df90815b2560d (diff) | |
download | brdo-2aa762436fd74688be242d64a90306ecfd0d8562.tar.gz brdo-2aa762436fd74688be242d64a90306ecfd0d8562.tar.bz2 |
- Fixed a warning. Patch by Jacobo Tarrio.
-rw-r--r-- | modules/search.module | 6 | ||||
-rw-r--r-- | modules/search/search.module | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/modules/search.module b/modules/search.module index d22bd57d9..186908ecf 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('%s', %d, '%s', %d)", $key, $node["lno"], $node_type, $value); + if ($newwords) { + foreach ($newwords as $key => $value) { + db_query("INSERT INTO search_index VALUES('%s', %d, '%s', %d)", $key, $node["lno"], $node_type, $value); + } } // Zap the weighted words array, so we don't add multiples. diff --git a/modules/search/search.module b/modules/search/search.module index d22bd57d9..186908ecf 100644 --- a/modules/search/search.module +++ b/modules/search/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('%s', %d, '%s', %d)", $key, $node["lno"], $node_type, $value); + if ($newwords) { + foreach ($newwords as $key => $value) { + db_query("INSERT INTO search_index VALUES('%s', %d, '%s', %d)", $key, $node["lno"], $node_type, $value); + } } // Zap the weighted words array, so we don't add multiples. |