Commit 12471e53 authored by David Johnson's avatar David Johnson

Return proper error.

parent fd45aa32
...@@ -2111,6 +2111,11 @@ function pm_parseuserquery($q,$debug = false) { ...@@ -2111,6 +2111,11 @@ function pm_parseuserquery($q,$debug = false) {
foreach ($toka as $i) { foreach ($toka as $i) {
# echo "needs = " . implode(',',$needs) . "; "; # echo "needs = " . implode(',',$needs) . "; ";
$sneed = whichsat($i,$needs); $sneed = whichsat($i,$needs);
if ($sneed == '') {
$errstr = "Parser error at token '$i'!";
break;
}
$needs = $trans[$sneed]; $needs = $trans[$sneed];
if (!isset($needs)) { if (!isset($needs)) {
$needs = array(); $needs = array();
...@@ -2118,11 +2123,6 @@ function pm_parseuserquery($q,$debug = false) { ...@@ -2118,11 +2123,6 @@ function pm_parseuserquery($q,$debug = false) {
# echo "sneed = $sneed; newneeds = " . implode(',',$needs) . "<br>\n"; # echo "sneed = $sneed; newneeds = " . implode(',',$needs) . "<br>\n";
if ($sneed == '') {
$errstr = "Malformed expression at token '$i'!";
break;
}
if ($sneed == 'ocont') { if ($sneed == 'ocont') {
++$oc; ++$oc;
$retq .= '('; $retq .= '(';
......
Markdown is supported
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