Hi,
it's quite a old post and I don't use it anymore... anyway I found the modified file.
Please note that it was used with an old version of advsearch 1.0 RC2 (I think) and also I'm not sure this is a safe solution, anyway:
public function sanitizeSearchString($searchString) {
if (!empty($searchString)) {
// remove "'"
$searchString=strtr($searchString,"'"," ");
$searchStringArray = explode(' ',$searchString);
//print_r($searchStringArray);
$searchStringArray = array_map("strip_tags",$this->modx->sanitize($searchStringArray, $this->modx->sanitizePatterns));
// change single chars with "AND"
foreach($searchStringArray as $word2) {
if (strlen($word2) < 3) {
$my_var[]=' AND ';
} else $my_var[]=$word2;
}
$searchString = implode(' ', $my_var);
// $searchString = implode(' ', $searchStringArray);
Another user wrote me some time ago that he got the following error:
"Inconsistent or invalid query".
And he solved this way:
- wrapped the query string with quotes prior submit using simple jQuery call.
- hacked 'advsearch.class.php' to accept minchars=1 for a query string
Hope you make it work