summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-01-14 16:31:08 +0100
committerRobin Appelman <icewind@owncloud.com>2014-01-14 16:31:08 +0100
commitc01949ec0eb54dbfbb2c29e43606b3a72ee42852 (patch)
tree6a23b3c9b2e033e766887c0fb9ad799433c0d826 /lib
parente706cf6c06a0111f9ec5db65e46f0fcc9261b456 (diff)
parentc3a0b0d7f3564ff7a8b80b5b375ea10f31282b8a (diff)
downloadnextcloud-server-c01949ec0eb54dbfbb2c29e43606b3a72ee42852.tar.gz
nextcloud-server-c01949ec0eb54dbfbb2c29e43606b3a72ee42852.zip
Merge branch 'master' into fileinfo
Diffstat (limited to 'lib')
-rw-r--r--lib/l10n/ru_RU.php12
-rw-r--r--lib/private/files/cache/cache.php22
-rwxr-xr-xlib/private/util.php2
3 files changed, 18 insertions, 18 deletions
diff --git a/lib/l10n/ru_RU.php b/lib/l10n/ru_RU.php
deleted file mode 100644
index 23e900721e8..00000000000
--- a/lib/l10n/ru_RU.php
+++ /dev/null
@@ -1,12 +0,0 @@
-<?php
-$TRANSLATIONS = array(
-"Help" => "Помощь",
-"Settings" => "Настройки",
-"Files" => "Файлы",
-"Text" => "Текст",
-"_%n minute ago_::_%n minutes ago_" => array("","",""),
-"_%n hour ago_::_%n hours ago_" => array("","",""),
-"_%n day go_::_%n days ago_" => array("","",""),
-"_%n month ago_::_%n months ago_" => array("","","")
-);
-$PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);";
diff --git a/lib/private/files/cache/cache.php b/lib/private/files/cache/cache.php
index 8e682a96b75..1e7936ca26d 100644
--- a/lib/private/files/cache/cache.php
+++ b/lib/private/files/cache/cache.php
@@ -178,7 +178,7 @@ class Cache {
if ($file['storage_mtime'] == 0) {
$file['storage_mtime'] = $file['mtime'];
}
- if ($file['encrypted']) {
+ if ($file['encrypted'] or ($file['unencrypted_size'] > 0 and $file['mimetype'] === 'httpd/unix-directory')) {
$file['encrypted_size'] = $file['size'];
$file['size'] = $file['unencrypted_size'];
}
@@ -511,22 +511,34 @@ class Cache {
$entry = $this->get($path);
if ($entry && $entry['mimetype'] === 'httpd/unix-directory') {
$id = $entry['fileid'];
- $sql = 'SELECT SUM(`size`) AS f1, MIN(`size`) AS f2 FROM `*PREFIX*filecache` '.
+ $sql = 'SELECT SUM(`size`) AS f1, MIN(`size`) AS f2, ' .
+ 'SUM(`unencrypted_size`) AS f3 ' .
+ 'FROM `*PREFIX*filecache` ' .
'WHERE `parent` = ? AND `storage` = ?';
$result = \OC_DB::executeAudited($sql, array($id, $this->getNumericStorageId()));
if ($row = $result->fetchRow()) {
- list($sum, $min) = array_values($row);
+ list($sum, $min, $unencryptedSum) = array_values($row);
$sum = (int)$sum;
$min = (int)$min;
+ $unencryptedSum = (int)$unencryptedSum;
if ($min === -1) {
$totalSize = $min;
} else {
$totalSize = $sum;
}
+ $update = array();
if ($entry['size'] !== $totalSize) {
- $this->update($id, array('size' => $totalSize));
+ $update['size'] = $totalSize;
+ }
+ if ($entry['unencrypted_size'] !== $unencryptedSum) {
+ $update['unencrypted_size'] = $unencryptedSum;
+ }
+ if (count($update) > 0) {
+ $this->update($id, $update);
+ }
+ if ($totalSize !== -1 and $unencryptedSum > 0) {
+ $totalSize = $unencryptedSum;
}
-
}
}
return $totalSize;
diff --git a/lib/private/util.php b/lib/private/util.php
index c0e618cc863..a4b3761dbd3 100755
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -580,7 +580,7 @@ class OC_Util {
// Check if we are a user
if( !OC_User::isLoggedIn()) {
header( 'Location: '.OC_Helper::linkToAbsolute( '', 'index.php',
- array('redirectUrl' => OC_Request::requestUri())
+ array('redirect_url' => OC_Request::requestUri())
));
exit();
}