aboutsummaryrefslogtreecommitdiffstats
path: root/lib/files/cache/legacy.php
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2013-06-07 14:11:05 +0200
committerJörn Friedrich Dreyer <jfd@butonic.de>2013-06-12 20:11:53 +0200
commitd3eadcde5662590846422a4dc6ed419a4367d90a (patch)
tree0c7dd885824074435677d70077b9a0d07537c93e /lib/files/cache/legacy.php
parenta39ecd5ea977f18fac9c7c3683a7988434f6b95f (diff)
downloadnextcloud-server-d3eadcde5662590846422a4dc6ed419a4367d90a.tar.gz
nextcloud-server-d3eadcde5662590846422a4dc6ed419a4367d90a.zip
use executeAudited in files cache
Diffstat (limited to 'lib/files/cache/legacy.php')
-rw-r--r--lib/files/cache/legacy.php15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/files/cache/legacy.php b/lib/files/cache/legacy.php
index ab8ae6dfadd..8eed1f67a5d 100644
--- a/lib/files/cache/legacy.php
+++ b/lib/files/cache/legacy.php
@@ -26,8 +26,8 @@ class Legacy {
* @return int
*/
function getCount() {
- $query = \OC_DB::prepare('SELECT COUNT(`id`) AS `count` FROM `*PREFIX*fscache` WHERE `user` = ?');
- $result = $query->execute(array($this->user));
+ $sql = 'SELECT COUNT(`id`) AS `count` FROM `*PREFIX*fscache` WHERE `user` = ?';
+ $result = \OC_DB::executeAudited($sql, array($this->user));
if ($row = $result->fetchRow()) {
return $row['count'];
} else {
@@ -74,11 +74,11 @@ class Legacy {
*/
function get($path) {
if (is_numeric($path)) {
- $query = \OC_DB::prepare('SELECT * FROM `*PREFIX*fscache` WHERE `id` = ?');
+ $sql = 'SELECT * FROM `*PREFIX*fscache` WHERE `id` = ?';
} else {
- $query = \OC_DB::prepare('SELECT * FROM `*PREFIX*fscache` WHERE `path` = ?');
+ $sql = 'SELECT * FROM `*PREFIX*fscache` WHERE `path` = ?';
}
- $result = $query->execute(array($path));
+ $result = \OC_DB::executeAudited($sql, array($path));
$data = $result->fetchRow();
$data['etag'] = $this->getEtag($data['path'], $data['user']);
return $data;
@@ -111,7 +111,7 @@ class Legacy {
if(is_null($query)){
$query = \OC_DB::prepare('SELECT `propertyvalue` FROM `*PREFIX*properties` WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = \'{DAV:}getetag\'');
}
- $result = $query->execute(array($user, '/' . $relativePath));
+ $result = \OC_DB::executeAudited($query,array($user, '/' . $relativePath));
if ($row = $result->fetchRow()) {
return trim($row['propertyvalue'], '"');
} else {
@@ -126,8 +126,7 @@ class Legacy {
* @return array
*/
function getChildren($id) {
- $query = \OC_DB::prepare('SELECT * FROM `*PREFIX*fscache` WHERE `parent` = ?');
- $result = $query->execute(array($id));
+ $result = \OC_DB::executeAudited('SELECT * FROM `*PREFIX*fscache` WHERE `parent` = ?', array($id));
$data = $result->fetchAll();
foreach ($data as $i => $item) {
$data[$i]['etag'] = $this->getEtag($item['path'], $item['user']);