Skip to content

Commit

Permalink
Vendor id3parser
Browse files Browse the repository at this point in the history
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
  • Loading branch information
rullzer committed Sep 6, 2018
1 parent 628dbc9 commit 74a2a6c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
12 changes: 6 additions & 6 deletions composer/installed.json
Expand Up @@ -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": {
Expand Down
12 changes: 11 additions & 1 deletion lukasreschke/id3parser/src/getID3/getid3_handler.php
Expand Up @@ -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) {
Expand Down

0 comments on commit 74a2a6c

Please sign in to comment.