Commit 4c630e8f authored by Dries's avatar Dries

- Patch #8497 by JonBob: check the length of a search key before inserting it.

parent bd4f4ebb
......@@ -293,7 +293,9 @@ function update_index($search_array) {
// the search index.
if ($newwords) {
foreach ($newwords as $key => $value) {
db_query("INSERT INTO {search_index} VALUES('%s', %d, '%s', %d)", $key, $node['lno'], $node_type, $value);
if (strlen($key) <= 50) {
db_query("INSERT INTO {search_index} VALUES('%s', %d, '%s', %d)", $key, $node['lno'], $node_type, $value);
}
}
}
......
......@@ -293,7 +293,9 @@ function update_index($search_array) {
// the search index.
if ($newwords) {
foreach ($newwords as $key => $value) {
db_query("INSERT INTO {search_index} VALUES('%s', %d, '%s', %d)", $key, $node['lno'], $node_type, $value);
if (strlen($key) <= 50) {
db_query("INSERT INTO {search_index} VALUES('%s', %d, '%s', %d)", $key, $node['lno'], $node_type, $value);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment