diff --git a/composer.json b/composer.json index 0dc792497..54a515040 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "jeremeamia/superclosure": "2.1.0", "leafo/scssphp": "0.7.7", "league/flysystem": "^1.0", - "lukasreschke/id3parser": "^0.0.1", + "lukasreschke/id3parser": "^0.0.3", "nikic/php-parser": "1.4.1", "patchwork/jsqueeze": "^2.0", "patchwork/utf8": "1.3.1", diff --git a/composer.lock b/composer.lock index d1e8383bb..e827668fb 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ea0e1173afefe5b185d6b46586da84c2", + "content-hash": "3ffb917bd2bbcd49da8c68085b51834b", "packages": [ { "name": "aws/aws-sdk-php", @@ -1440,16 +1440,16 @@ }, { "name": "lukasreschke/id3parser", - "version": "v0.0.1", + "version": "v0.0.3", "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": { @@ -1471,7 +1471,7 @@ "php", "tags" ], - "time": "2016-04-04T09:34:50+00:00" + "time": "2016-09-22T15:10:54+00:00" }, { "name": "microsoft/azure-storage-blob", 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) {