Skip to content

Commit

Permalink
Merge 621957e into 92b5fea
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathias Chouet committed Dec 9, 2015
2 parents 92b5fea + 621957e commit 36b2917
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,8 +510,12 @@ private function getPartBodyFromFile(&$part)
{
$start = $part['starting-pos-body'];
$end = $part['ending-pos-body'];
fseek($this->stream, $start, SEEK_SET);
return fread($this->stream, $end-$start);
$body = '';
if ($end-$start > 0) {
fseek($this->stream, $start, SEEK_SET);
$body = fread($this->stream, $end-$start);
}
return $body;
}

/**
Expand Down

0 comments on commit 36b2917

Please sign in to comment.