Permalink
Browse files

Added some NOTICE level error checking

  • Loading branch information...
1 parent 5f7881a commit 09846dd56bd0c4a37f01e068733c82046014a788 @ajaxray committed Dec 2, 2011
Showing with 11 additions and 9 deletions.
  1. +8 −6 logviewer/classes/model/logreport.php
  2. +3 −3 logviewer/views/logs/report.php
@@ -42,12 +42,14 @@ protected function _createLogEntries()
$log = array();
$log['raw'] = $logRaw;
- $log['time'] = strtotime($matches[1]);
- $log['level'] = $matches[2]; // Notice, Error etc.
- $log['style'] = $this->_getStyle($matches[2]); // CSS class for styling
- $log['type'] = $matches[3]; // Exception name
- $log['message'] = $matches[4];
- $log['file'] = $matches[5];
+ if($matches) {
+ $log['time'] = strtotime($matches[1]);
+ $log['level'] = $matches[2]; // Notice, Error etc.
+ $log['style'] = $this->_getStyle($matches[2]); // CSS class for styling
+ $log['type'] = $matches[3]; // Exception name
+ $log['message'] = $matches[4];
+ $log['file'] = $matches[5];
+ }
$this->_logEntries[] = $log;
}
@@ -16,7 +16,7 @@
?>
</select>&nbsp;
- <?php if($_GET['mode'] == 'raw'): ?>
+ <?php if(isset($_GET['mode']) and $_GET['mode'] == 'raw'): ?>
<a class="btn success" href="?mode=formatted">formatted mode</a>
<?php else: ?>
<a class="btn info" href="?mode=raw">raw mode</a>
@@ -25,7 +25,7 @@
</form>
</div>
<table class="zebra-striped" width="100%">
- <?php if($_GET['mode'] != 'raw'): ?>
+ <?php if(isset($_GET['mode']) and $_GET['mode'] != 'raw'): ?>
<thead>
<tr>
<th width="5%">Level</th>
@@ -39,7 +39,7 @@
<tbody>
<?php foreach ($logs as $log):?>
<tr>
- <?php if($_GET['mode'] != 'raw'): ?>
+ <?php if(isset($_GET['mode']) and $_GET['mode'] != 'raw'): ?>
<td rowspan="2">
<span class="label <?php echo $log['style'] ?>"> <?php echo $log['level'] ?> </span>
</td>

0 comments on commit 09846dd

Please sign in to comment.