BUGFIX Ensure that Relevance field check in MSSQLDatabase::searchEngine() also checks for Relevance escaped in double quotes

This commit is contained in:
Sean Harvey 2010-11-01 03:20:52 +00:00
parent 7b6899b3f0
commit 9e1cdc8cfa

View File

@ -1263,7 +1263,7 @@ class MSSQLDatabase extends SS_Database {
public function searchEngine($classesToSearch, $keywords, $start, $pageLength, $sortBy = "Relevance DESC", $extraFilter = "", $booleanSearch = false, $alternativeFileFilter = "", $invertedMatch = false) { public function searchEngine($classesToSearch, $keywords, $start, $pageLength, $sortBy = "Relevance DESC", $extraFilter = "", $booleanSearch = false, $alternativeFileFilter = "", $invertedMatch = false) {
$results = new DataObjectSet(); $results = new DataObjectSet();
if(!$this->fullTextEnabled()) return $results; if(!$this->fullTextEnabled()) return $results;
if (substr($sortBy, 0, 9)!='Relevance') user_error("Non-relevance sort not supported.", E_USER_ERROR); if (!in_array(substr($sortBy, 0, 9), array('"Relevanc', 'Relevance'))) user_error("Non-relevance sort not supported.", E_USER_ERROR);
$allClassesToSearch = array(); $allClassesToSearch = array();
foreach ($classesToSearch as $class) { foreach ($classesToSearch as $class) {