File tree 1 file changed +3
-0
lines changed
1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -274,6 +274,7 @@ public function stream_close()
274
274
if (file_exists ($ this ->tmp2 )) unlink ($ this ->tmp2 );
275
275
} else {
276
276
$ this ->data = null ;
277
+ $ this ->dataSize = 0 ;
277
278
}
278
279
}
279
280
@@ -339,6 +340,7 @@ public function stream_write($data)
339
340
$ postfix = substr ($ this ->data , ($ this ->pointer + $ count ));
340
341
$ this ->data = $ prefix .$ data .$ postfix ;
341
342
$ this ->pointer += $ count ;
343
+ $ this ->dataSize = strlen ($ this ->data );
342
344
343
345
return $ count ;
344
346
}
@@ -396,6 +398,7 @@ public function stream_truncate($new_size)
396
398
} elseif ($ new_size < $ actual_data_size ) {
397
399
if ($ this ->tmp === null ) {
398
400
$ this ->data = substr ($ this ->data , 0 , $ new_size );
401
+ $ this ->dataSize = strlen ($ this ->data );
399
402
$ this ->writtenBytes = $ new_size ;
400
403
} else {
401
404
$ fp = fopen ($ this ->tmp , 'w ' .(strpos ($ this ->mode , 'b ' ) !== 0
You can’t perform that action at this time.
0 commit comments