summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2002-05-26 11:00:50 +0000
committerDries Buytaert <dries@buytaert.net>2002-05-26 11:00:50 +0000
commit0908a06cd0a1b275f6cd29388ef0af1fffd8fd7e (patch)
tree5dbf83aa38e42eadbe8a1574d83961f4d39b42fb /modules
parent4191481453a6fc68821ed91ab404f19d062c8eef (diff)
downloadbrdo-0908a06cd0a1b275f6cd29388ef0af1fffd8fd7e.tar.gz
brdo-0908a06cd0a1b275f6cd29388ef0af1fffd8fd7e.tar.bz2
- 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.
Diffstat (limited to 'modules')
-rw-r--r--modules/search.module7
-rw-r--r--modules/search/search.module7
2 files changed, 6 insertions, 8 deletions
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 ();
}
}