2
0
Эх сурвалжийг харах

Merge pull request #1287 from cvuorinen/1286-fopen-check

Check file was opened successfully before trying to read/write
Jordi Boggiano 6 жил өмнө
parent
commit
3920e83832

+ 5 - 0
src/Monolog/Handler/DeduplicationHandler.php

@@ -137,6 +137,11 @@ class DeduplicationHandler extends BufferHandler
         }
 
         $handle = fopen($this->deduplicationStore, 'rw+');
+
+        if (!$handle) {
+            throw new \RuntimeException('Failed to open file for reading and writing: ' . $this->deduplicationStore);
+        }
+
         flock($handle, LOCK_EX);
         $validLogs = [];