X Tutup
Skip to content

Commit c368786

Browse files
committed
Make sure availableSpace is an int
1 parent 360fc0f commit c368786

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/dav/lib/Connector/Sabre/QuotaPlugin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ public function checkQuota($path, $length = null, $extraSpace = 0) {
204204
$path = \rtrim($parentPath, '/') . '/' . $info['name'];
205205
}
206206
$freeSpace = $this->getFreeSpace($path);
207-
// freeSpace might be false, or an int. Anyway, availableSpace will be an int. (false + int returns an int)
208-
$availableSpace = $freeSpace + $extraSpace;
207+
// freeSpace might be false, or an int. Anyway, make sure that availableSpace will be an int.
208+
$availableSpace = (int) $freeSpace + $extraSpace;
209209
if ($freeSpace !== FileInfo::SPACE_UNKNOWN && $freeSpace !== FileInfo::SPACE_UNLIMITED && (($length > $availableSpace) || ($availableSpace === 0))) {
210210
if (isset($chunkHandler)) {
211211
$chunkHandler->cleanup();

0 commit comments

Comments
 (0)
X Tutup