]> source.dussan.org Git - nextcloud-server.git/commitdiff
Prevent division by zero
authorLukas Reschke <lukas@owncloud.com>
Thu, 23 Oct 2014 22:10:22 +0000 (00:10 +0200)
committerLukas Reschke <lukas@owncloud.com>
Thu, 23 Oct 2014 22:10:22 +0000 (00:10 +0200)
Potentially fixes https://github.com/owncloud/core/issues/11742

apps/files/ajax/newfile.php

index 392fc5bd1c8d72c1153c3344b8cdb43623bccbf4..b4d91514a2aa7fb6fc89658ab6311daf899c5341 100644 (file)
@@ -33,7 +33,7 @@ function progress($notification_code, $severity, $message, $message_code, $bytes
 
                case STREAM_NOTIFY_PROGRESS:
                        if ($bytes_transferred > 0) {
-                               if (!isset($filesize)) {
+                               if (!isset($filesize) || $filesize === 0) {
                                } else {
                                        $progress = (int)(($bytes_transferred/$filesize)*100);
                                        if($progress>$lastsize) { //limit the number or messages send