From 74a2a6cb97ceaa3e787c114e0545fe0499821354 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 6 Sep 2018 22:53:46 +0200 Subject: [PATCH] Vendor id3parser Signed-off-by: Roeland Jago Douma --- composer/installed.json | 12 ++++++------ lukasreschke/id3parser/src/getID3/getid3_handler.php | 12 +++++++++++- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/composer/installed.json b/composer/installed.json index 477761cca..b947f7da1 100644 --- a/composer/installed.json +++ b/composer/installed.json @@ -1481,23 +1481,23 @@ }, { "name": "lukasreschke/id3parser", - "version": "v0.0.1", - "version_normalized": "0.0.1.0", + "version": "v0.0.3", + "version_normalized": "0.0.3.0", "source": { "type": "git", "url": "https://github.com/LukasReschke/ID3Parser.git", - "reference": "cd3ba6e8918cc30883f01a3c24281cfe23b8877a" + "reference": "62f4de76d4eaa9ea13c66dacc1f22977dace6638" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/LukasReschke/ID3Parser/zipball/cd3ba6e8918cc30883f01a3c24281cfe23b8877a", - "reference": "cd3ba6e8918cc30883f01a3c24281cfe23b8877a", + "url": "https://api.github.com/repos/LukasReschke/ID3Parser/zipball/62f4de76d4eaa9ea13c66dacc1f22977dace6638", + "reference": "62f4de76d4eaa9ea13c66dacc1f22977dace6638", "shasum": "" }, "require": { "php": ">=5.4.0" }, - "time": "2016-04-04T09:34:50+00:00", + "time": "2016-09-22T15:10:54+00:00", "type": "library", "installation-source": "dist", "autoload": { diff --git a/lukasreschke/id3parser/src/getID3/getid3_handler.php b/lukasreschke/id3parser/src/getID3/getid3_handler.php index 654593349..f1f43f6ba 100644 --- a/lukasreschke/id3parser/src/getID3/getid3_handler.php +++ b/lukasreschke/id3parser/src/getID3/getid3_handler.php @@ -84,7 +84,17 @@ protected function fread($bytes) { if (!getid3_lib::intValueSupported($pos)) { throw new getid3_exception('cannot fread('.$bytes.' from '.$this->ftell().') because beyond PHP filesystem limit', 10); } - return fread($this->getid3->fp, $bytes); + + // System fread function may return less data than requested in case the file is not a regular local file. + // See http://php.net/manual/en/function.fread.php. Call it repeatedly in a loop if that is the case. + $contents = ''; + do { + $part = fread($this->getid3->fp, $bytes); + $partLength = strlen($part); + $bytes -= $partLength; + $contents .= $part; + } while ($bytes > 0 && $partLength > 0); + return $contents; } protected function fseek($bytes, $whence=SEEK_SET) {