Commit 919a4e75 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Fix MATCH statement. Also improve search.

parent c4e5bb42
......@@ -45,7 +45,7 @@ $extraclause = "";
PAGEHEADER("Image Search");
if (isset($searchfor) && isset($searchby)) {
if (! preg_match('/^[-\w\:,\.\+]+$/', $searchfor)) {
if (! preg_match('/^[\w\:,\.\+]+$/', $searchfor)) {
USERERROR("Illegal characters in search clause", 1);
}
if ($searchby == "nodetype") {
......@@ -68,8 +68,8 @@ if (isset($searchfor) && isset($searchby)) {
}
elseif ($searchby == "namedesc") {
$safe_searchfor = addslashes($searchfor);
$extraclause = "and (match (i.imagename,iv.description) ".
"against('$safe_searchfor'))";
$extraclause = "and (match (iv.imagename,iv.description) ".
"against('*${safe_searchfor}*'))";
}
}
else {
......
Supports Markdown
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