Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

fix read of 8192 bytes failed with errno=21 Is a directory #244

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix read of 8192 bytes failed with errno=21 Is a directory
  • Loading branch information
remicollet committed Oct 9, 2019
commit 3b4761424fdb494262f7f4c215c9dbd19cca53e0
6 changes: 3 additions & 3 deletions src/Storage/Mbox.php
Original file line number Diff line number Diff line change
@@ -216,8 +216,8 @@ public function __construct($params)
*/
protected function isMboxFile($file, $fileIsString = true)
{
ErrorHandler::start(E_NOTICE);
if ($fileIsString) {
ErrorHandler::start(E_WARNING);
$file = fopen($file, 'r');
ErrorHandler::stop();
if (! $file) {
@@ -230,15 +230,15 @@ protected function isMboxFile($file, $fileIsString = true)
$result = false;

$line = fgets($file) ?: '';

if (strpos($line, 'From ') === 0) {
$result = true;
}

if ($fileIsString) {
ErrorHandler::start(E_WARNING);
fclose($file);
ErrorHandler::stop();
}
ErrorHandler::stop();

return $result;
}