From 0908a06cd0a1b275f6cd29388ef0af1fffd8fd7e Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 26 May 2002 11:00:50 +0000 Subject: - Replaced a "mysql_query()" by a "db_query" as identified by Moshe (see his sandbox) and fixed some typos in the module's comments. * Moshe: what are the $wordlist changes you made? Mind to elaborate a bit on those? * TODO: validate the SQL queries used in the search module using a SQL validator tool - I wonder whether they are ANSI compliant. - // If the word is preceeded by a "+", then this word is required, and + // If the word is proceeded by a "+", then this word is required, and - $inputword = ("INSERT INTO search_index VALUES('$key', ". $node["lno"] .", '$node_type', $value)"); - mysql_query($inputword); + db_query("INSERT INTO search_index VALUES('$key', ". $node["lno"] .", '$node_type', $value)"); } - // Zap the weighted words array, so we dont add multiples. + // Zap the weighted words array, so we don't add multiples. --- modules/search.module | 7 +++---- modules/search/search.module | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'modules') diff --git a/modules/search.module b/modules/search.module index dd40b02ca..b441b096a 100644 --- a/modules/search.module +++ b/modules/search.module @@ -112,7 +112,7 @@ function do_search($search_array) { if (strlen($word) < variable_get("remove_short", 0)) { continue; } - // If the word is preceeded by a "+", then this word is required, and + // If the word is proceeded by a "+", then this word is required, and // pages that match other words, but not this one will be removed if (substr($word, 0, 1) == "+") { $word = substr($word, 1); @@ -286,11 +286,10 @@ function update_index($search_array) { // Walk through the weighted words array, inserting them into // the search index foreach ($newwords as $key => $value) { - $inputword = ("INSERT INTO search_index VALUES('$key', ". $node["lno"] .", '$node_type', $value)"); - mysql_query($inputword); + db_query("INSERT INTO search_index VALUES('$key', ". $node["lno"] .", '$node_type', $value)"); } - // Zap the weighted words array, so we dont add multiples. + // Zap the weighted words array, so we don't add multiples. $newwords = array (); } } diff --git a/modules/search/search.module b/modules/search/search.module index dd40b02ca..b441b096a 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -112,7 +112,7 @@ function do_search($search_array) { if (strlen($word) < variable_get("remove_short", 0)) { continue; } - // If the word is preceeded by a "+", then this word is required, and + // If the word is proceeded by a "+", then this word is required, and // pages that match other words, but not this one will be removed if (substr($word, 0, 1) == "+") { $word = substr($word, 1); @@ -286,11 +286,10 @@ function update_index($search_array) { // Walk through the weighted words array, inserting them into // the search index foreach ($newwords as $key => $value) { - $inputword = ("INSERT INTO search_index VALUES('$key', ". $node["lno"] .", '$node_type', $value)"); - mysql_query($inputword); + db_query("INSERT INTO search_index VALUES('$key', ". $node["lno"] .", '$node_type', $value)"); } - // Zap the weighted words array, so we dont add multiples. + // Zap the weighted words array, so we don't add multiples. $newwords = array (); } } -- cgit v1.2.3