Browse Source

Check 'context' before 'extra'

First check 'context' array, before 'extra' array is checked
Rvanlaak 11 years ago
parent
commit
6c35b82256
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/Monolog/Handler/PushoverHandler.php

+ 3 - 1
src/Monolog/Handler/PushoverHandler.php

@@ -101,7 +101,9 @@ class PushoverHandler extends SocketHandler
             $dataArray['priority'] = 1;
         }
         
-        if (isset($record['extra']['sound']) && in_array($record['extra']['sound'], $this->sounds)) {
+        if (isset($record['context']['sound']) && in_array($record['context']['sound'], $this->sounds)) {
+            $dataArray['sound'] = $record['context']['sound'];
+        } elseif (isset($record['extra']['sound']) && in_array($record['extra']['sound'], $this->sounds)) {
             $dataArray['sound'] = $record['extra']['sound'];
         }