[Pkg-owncloud-commits] [owncloud] 377/394: fix foldersize check to validate zip input size
David Prévot
taffit at alioth.debian.org
Fri Nov 8 23:12:54 UTC 2013
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag v4.5.10
in repository owncloud.
commit 0de2c955fc356289439d7accef705d7546552d02
Author: Arthur Schiwon <blizzz at owncloud.com>
Date: Sat Mar 9 14:14:29 2013 +0100
fix foldersize check to validate zip input size
---
lib/files.php | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/lib/files.php b/lib/files.php
index ade11d0..41d2261 100644
--- a/lib/files.php
+++ b/lib/files.php
@@ -345,12 +345,18 @@ class OC_Files {
$zipLimit = OC_Config::getValue('maxZipInputSize', OC_Helper::computerFileSize('800 MB'));
if($zipLimit > 0) {
$totalsize = 0;
- if(is_array($files)) {
- foreach($files as $file) {
- $totalsize += OC_Filesystem::filesize($dir.'/'.$file);
+ if(!is_array($files)) {
+ $files = array($files);
+ }
+ foreach($files as $file) {
+ $path = $dir.'/'.$file;
+ if(OC_Filesystem::is_dir($path)) {
+ foreach(OC_Files::getDirectoryContent($path) as $i) {
+ $totalsize += $i['size'];
+ }
+ } else {
+ $totalsize += OC_Filesystem::filesize($path);
}
- }else{
- $totalsize += OC_Filesystem::filesize($dir.'/'.$files);
}
if($totalsize > $zipLimit) {
$l = OC_L10N::get('lib');
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list