summaryrefslogtreecommitdiffstats
path: root/wp-includes/streams.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/streams.php')
-rw-r--r--wp-includes/streams.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/wp-includes/streams.php b/wp-includes/streams.php
index c69841e..8cf1c48 100644
--- a/wp-includes/streams.php
+++ b/wp-includes/streams.php
@@ -105,7 +105,14 @@ class FileReader {
function read($bytes) {
if ($bytes) {
fseek($this->_fd, $this->_pos);
- $data = fread($this->_fd, $bytes);
+
+ // PHP 5.1.1 does not read more than 8192 bytes in one fread()
+ // the discussions at PHP Bugs suggest it's the intended behaviour
+ while ($bytes > 0) {
+ $chunk = fread($this->_fd, $bytes);
+ $data .= $chunk;
+ $bytes -= strlen($chunk);
+ }
$this->_pos = ftell($this->_fd);
return $data;
@@ -156,4 +163,4 @@ class CachedFileReader extends StringReader {
}
-?> \ No newline at end of file
+?>