Jordi Boggiano 9 лет назад
Родитель
Сommit
85e43a5e7b
2 измененных файлов с 3 добавлено и 3 удалено
  1. 2 2
      src/Monolog/Handler/NewRelicHandler.php
  2. 1 1
      src/Monolog/Handler/StreamHandler.php

+ 2 - 2
src/Monolog/Handler/NewRelicHandler.php

@@ -92,7 +92,7 @@ class NewRelicHandler extends AbstractProcessingHandler
             newrelic_notice_error($record['message']);
         }
 
-        if (isset($record['formatted']['context'])) {
+        if (isset($record['formatted']['context']) && is_array($record['formatted']['context'])) {
             foreach ($record['formatted']['context'] as $key => $parameter) {
                 if (is_array($parameter) && $this->explodeArrays) {
                     foreach ($parameter as $paramKey => $paramValue) {
@@ -104,7 +104,7 @@ class NewRelicHandler extends AbstractProcessingHandler
             }
         }
 
-        if (isset($record['formatted']['extra'])) {
+        if (isset($record['formatted']['extra']) && is_array($record['formatted']['extra'])) {
             foreach ($record['formatted']['extra'] as $key => $parameter) {
                 if (is_array($parameter) && $this->explodeArrays) {
                     foreach ($parameter as $paramKey => $paramValue) {

+ 1 - 1
src/Monolog/Handler/StreamHandler.php

@@ -81,7 +81,7 @@ class StreamHandler extends AbstractProcessingHandler
     protected function write(array $record)
     {
         if (!is_resource($this->stream)) {
-            if (!$this->url) {
+            if (null === $this->url || '' === $this->url) {
                 throw new \LogicException('Missing stream url, the stream can not be opened. This may be caused by a premature call to close().');
             }
             $this->createDir();