In case a hyphen (-) was preceded and followed by spaces,
the pattern for the "not regex" was empty causing an empty response from the database.
$searchcond[] = "$concat $REGEXP :ss$i";
$params['ss'.$i] = "(^|[^a-zA-Z0-9])$searchterm([^a-zA-Z0-9]|$)";
- } else if (substr($searchterm,0,1) == "-") {
+ } else if ((substr($searchterm,0,1) == "-") && (core_text::strlen($searchterm) > 1)) {
$searchterm = trim($searchterm, '+-');
$searchterm = preg_quote($searchterm, '|');
$searchcond[] = "$concat $NOTREGEXP :ss$i";