- 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.4.0.x
parent
4191481453
commit
0908a06cd0
|
@ -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 ();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 ();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue