summaryrefslogtreecommitdiffstats
path: root/244.patch
blob: f2d42a5a65a925511a7c1f99e1b1df15647cd004 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From 3b4761424fdb494262f7f4c215c9dbd19cca53e0 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Wed, 9 Oct 2019 13:49:30 +0200
Subject: [PATCH] fix read of 8192 bytes failed with errno=21 Is a directory

---
 src/Storage/Mbox.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/Storage/Mbox.php b/src/Storage/Mbox.php
index 30de89cd..8ae352ac 100644
--- a/src/Storage/Mbox.php
+++ b/src/Storage/Mbox.php
@@ -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;
     }