aboutsummaryrefslogtreecommitdiffstats
path: root/lib/helper.php
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-02-22 14:56:50 +0100
committerBjörn Schießle <schiessle@owncloud.com>2013-02-22 14:56:50 +0100
commit5b949596867c986916568e5bea2003e04102aa71 (patch)
tree8a6f7b1cf2d7d98763b1fb35499f511530791909 /lib/helper.php
parent51d050c93515215f5053113c617a4c49c4a4474e (diff)
downloadnextcloud-server-5b949596867c986916568e5bea2003e04102aa71.tar.gz
nextcloud-server-5b949596867c986916568e5bea2003e04102aa71.zip
using the number of writen bytes as indicator if streamCopy() was successfully. Instead check if fwrite returns the number of bytes or false
Diffstat (limited to 'lib/helper.php')
-rw-r--r--lib/helper.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/helper.php b/lib/helper.php
index add5c66e7be..2c9cd36b199 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -513,11 +513,13 @@ class OC_Helper {
if(!$source or !$target) {
return false;
}
- $count=0;
+ $result=true;
while(!feof($source)) {
- $count+=fwrite($target, fread($source, 8192));
+ if (fwrite($target, fread($source, 8192)) === false) {
+ $result = false;
+ }
}
- return $count;
+ return $result;
}
/**