Project

General

Profile

Bug #22049 » 13412_core.diff

Administrator Admin, 2010-02-03 15:15

View differences:

t3lib/class.t3lib_sqlparser.php (working copy)
}
// Find "comparator":
$stack[$level][$pnt[$level]]['comparator'] = $this->nextPart($parseString, '^(<=|>=|<|>|=|!=|NOT[[:space:]]+IN|IN|NOT[[:space:]]+LIKE|LIKE|IS[[:space:]]+NOT|IS)');
$stack[$level][$pnt[$level]]['comparator'] = $this->nextPart($parseString, '^(<=|>=|<|>|=|!=|NOT[[:space:]]+IN|IN|NOT[[:space:]]+LIKE|LIKE|IS[[:space:]]+NOT|IS|BETWEEN|NOT[[:space]]+BETWEEN)');
if (strlen($stack[$level][$pnt[$level]]['comparator'])) {
if (preg_match('/^CONCAT[[:space:]]*\(/', $parseString)) {
$this->nextPart($parseString, '^(CONCAT[[:space:]]?[(])');
......
if (!$this->nextPart($parseString, '^([)])')) {
return 'No ) parenthesis at end of subquery';
}
} else if (t3lib_div::inList('BETWEEN,NOT BETWEEN', $stack[$level][$pnt[$level]]['comparator'])) {
$stack[$level][$pnt[$level]]['values'] = array();
$stack[$level][$pnt[$level]]['values'][0] = $this->getValue($parseString);
if (!$this->nextPart($parseString, '^(AND)')) {
return $this->parseError('No AND operator found as expected in parseWhereClause()', $parseString);
}
$stack[$level][$pnt[$level]]['values'][1] = $this->getValue($parseString);
} else {
// Finding value for comparator:
$stack[$level][$pnt[$level]]['value'] = $this->getValue($parseString, $stack[$level][$pnt[$level]]['comparator']);
......
}
$output .= ' (' . trim(implode(',', $valueBuffer)) . ')';
}
} else if (t3lib_div::inList('BETWEEN,NOT BETWEEN', $v['comparator'])) {
$lbound = $v['values'][0];
$ubound = $v['values'][1];
$output .= ' ' . $lbound[1] . $this->compileAddslashes($lbound[0]) . $lbound[1];
$output .= ' AND ';
$output .= $ubound[1] . $this->compileAddslashes($ubound[0]) . $ubound[1];
} else if (isset($v['value']['operator'])) {
$values = array();
foreach ($v['value']['args'] as $fieldDef) {
(1-1/2)