summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-03-15 11:06:51 +0100
committerBjörn Schießle <schiessle@owncloud.com>2013-03-15 12:10:07 +0100
commite37e884d7a861f9321e993711c17ac5b1386b116 (patch)
treefb727cc011fd31ee9597d12a148b5a6e528773b0 /apps
parent23fe98a562e9a4e319a8d46d147364f2b3c7c490 (diff)
downloadnextcloud-server-e37e884d7a861f9321e993711c17ac5b1386b116.tar.gz
nextcloud-server-e37e884d7a861f9321e993711c17ac5b1386b116.zip
add backtick for db queries to prevent postgresql errors
Diffstat (limited to 'apps')
-rw-r--r--apps/files_versions/lib/versions.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php
index f99e26a0915..5fc26fd090e 100644
--- a/apps/files_versions/lib/versions.php
+++ b/apps/files_versions/lib/versions.php
@@ -53,7 +53,7 @@ class Storage {
* @return mixed versions size or false if no versions size is stored
*/
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();
if ($result) {
@@ -70,9 +70,9 @@ class Storage {
*/
private static function setVersionsSize($user, $size) {
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 {
- $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));
}