mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
Fix for smb4php fseek
The stream_fseek function must return a boolean which will be mapped to 0 for success and -1 for failure for the caller. This patch fixes stream_fseek of smb4php to also respect this convention. Since the encryption app is relying on fseek to detect whether a file is encrypted by reading the last bit of data, this will fix #5023
This commit is contained in:
parent
630e46f60a
commit
f9a64d2b27
1 changed files with 2 additions and 1 deletions
3
apps/files_external/3rdparty/smb4php/smb.php
vendored
3
apps/files_external/3rdparty/smb4php/smb.php
vendored
|
|
@ -460,7 +460,8 @@ class smb_stream_wrapper extends smb {
|
|||
|
||||
function stream_tell () { return ftell($this->stream); }
|
||||
|
||||
function stream_seek ($offset, $whence=null) { return fseek($this->stream, $offset, $whence); }
|
||||
// PATCH: the wrapper must return true when fseek succeeded by returning 0.
|
||||
function stream_seek ($offset, $whence=null) { return fseek($this->stream, $offset, $whence) === 0; }
|
||||
|
||||
function stream_flush () {
|
||||
if ($this->mode <> 'r' && $this->need_flush) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue