Merge pull request #55731 from nextcloud/jtr/fix-files-stream-quota-actual

fix(files): decrement quota by actual bytes written in stream_write
pull/55743/head
Ferdinand Thiessen 2025-10-14 13:56:27 +07:00 committed by GitHub
commit 48378aede3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 2 deletions

@ -78,7 +78,10 @@ class Quota extends Wrapper {
$data = substr($data, 0, $this->limit);
$size = $this->limit;
}
$this->limit -= $size;
return fwrite($this->source, $data);
$written = fwrite($this->source, $data);
// Decrement quota by the actual number of bytes written ($written),
// not the intended size
$this->limit -= $written;
return $written;
}
}