Browse Source

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
remotes/origin/stable6
Vincent Petry 12 years ago
parent
commit
f9a64d2b27
  1. 3
      apps/files_external/3rdparty/smb4php/smb.php

3
apps/files_external/3rdparty/smb4php/smb.php

@ -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…
Cancel
Save