[fix] Excessive quotation in tag searches.

This commit is contained in:
Solomon Peachy 2008-10-30 11:45:59 -04:00
parent bb94b6efc7
commit 74013fcb06
3 changed files with 5 additions and 1 deletions

View File

@ -45,6 +45,7 @@ For further information about Photo Organizer, see its web site at:
[add] Initial background image import/processing worker.
[add] Pretty-URL the folder search too.
[misc] Vastly speed up searching for "multi-word matches"
[fix] Fix """"excessive"""" quotation in tag searches.
2.36.1 (September 27, 2008)

View File

@ -73,6 +73,9 @@ function validate_search_string($search_string) {
$search_string = str_replace("\'", """, $search_string);
$search_string = str_replace("*", "", $search_string);
$search_string = str_replace("?", "", $search_string);
if ($strpos($search_string, ' ') !== FALSE) {
$search_string = '"'.$search_string.'"';
}
return $search_string;
}

View File

@ -24,7 +24,7 @@ include_once "include/orderby.php";
include_once "include/stemming.php";
include_once "include/search.php";
$search_data = isset($_REQUEST['keyword']) ? validate_search_string('"'.$_REQUEST['keyword'].'"') : "";
$search_data = isset($_REQUEST['keyword']) ? validate_search_string($_REQUEST['keyword']) : "";
$master = isset($_REQUEST['only_masters']);
$offset = pg_escape_string(isset($_REQUEST['offset']) ? $_REQUEST['offset'] : 0);