Commit a7ad3714 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Evaluate.php: add a check for better error detection.

parent 88cd2fff
......@@ -212,7 +212,7 @@ class Evaluate {
$dbIndex = $this->dbIndex;
// Check if the $token starts with '[<int>]...' - yes: open the necessary database.
if ($token[0] === '[') {
if (strlen($token) > 2 && $token[0] === '[') {
if ($token[2] !== ']') {
throw new UserFormException("Missing token ']' in '$token' on position 3", ERROR_TOKEN_MISSING);
}
......@@ -224,6 +224,10 @@ class Evaluate {
}
}
if ($token === '') {
return '';
}
if ($token[0] === '!') {
$token = trim(substr($token, 1));
$sqlMode = ROW_REGULAR;
......
Supports Markdown
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