add backtick for db queries to prevent postgresql errors

This commit is contained in:
Björn Schießle 2013-03-15 11:06:51 +01:00
parent 23fe98a562
commit e37e884d7a
1 changed files with 3 additions and 3 deletions

View File

@ -53,7 +53,7 @@ class Storage {
* @return mixed versions size or false if no versions size is stored * @return mixed versions size or false if no versions size is stored
*/ */
private static function getVersionsSize($user) { private static function getVersionsSize($user) {
$query = \OC_DB::prepare('SELECT size FROM *PREFIX*files_versions WHERE user=?'); $query = \OC_DB::prepare('SELECT `size` FROM `*PREFIX*files_versions` WHERE `user`=?');
$result = $query->execute(array($user))->fetchAll(); $result = $query->execute(array($user))->fetchAll();
if ($result) { if ($result) {
@ -70,9 +70,9 @@ class Storage {
*/ */
private static function setVersionsSize($user, $size) { private static function setVersionsSize($user, $size) {
if ( self::getVersionsSize($user) === false) { if ( self::getVersionsSize($user) === false) {
$query = \OC_DB::prepare('INSERT INTO *PREFIX*files_versions (size, user) VALUES (?, ?)'); $query = \OC_DB::prepare('INSERT INTO `*PREFIX*files_versions` (`size`, `user`) VALUES (?, ?)');
}else { }else {
$query = \OC_DB::prepare('UPDATE *PREFIX*files_versions SET size=? WHERE user=?'); $query = \OC_DB::prepare('UPDATE `*PREFIX*files_versions` SET `size`=? WHERE `user`=?');
} }
$query->execute(array($size, $user)); $query->execute(array($size, $user));
} }