Index: Classes/Persistence/Storage/Typo3DbBackend.php =================================================================== --- Classes/Persistence/Storage/Typo3DbBackend.php (revision 10137) +++ Classes/Persistence/Storage/Typo3DbBackend.php (working copy) @@ -747,11 +747,11 @@ } elseif (is_array($parameter) || ($parameter instanceof ArrayAccess) || ($parameter instanceof Traversable)) { $items = array(); foreach ($parameter as $item) { - $items[] = $this->databaseHandle->fullQuoteStr($item, 'foo'); + $items[] = $this->correctEscape($item); } $parameter = '(' . implode(',', $items) . ')'; } else { - $parameter = $this->databaseHandle->fullQuoteStr($parameter, 'foo'); // FIXME This may not work with DBAL; check this + $parameter = $this->correctEscape($parameter); } $sqlString = substr($sqlString, 0, $markPosition) . $parameter . substr($sqlString, $markPosition + 1); } @@ -759,6 +759,16 @@ } } + protected function correctEscape($value) { + if (is_int($value)) { + return $value; + } elseif((int)$value == $value) { + return (int)$value; + } else { + return $this->databaseHandle->fullQuoteStr($item, 'foo'); // FIXME This may not work with DBAL; check this + } + } + /** * Adds additional WHERE statements according to the query settings. *