Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/techsneeze/dmarcts-report-viewer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniƫl <daniel.bareman@gmail.com>2022-03-09 14:22:30 +0300
committerGitHub <noreply@github.com>2022-03-09 14:22:30 +0300
commit34694e7b47db193744889010c5bba8b142e9b52f (patch)
treec05b529d1d91d754e8c6c87f45b218566ee87e3f
parent749dfb1d6294268fc7a683a6577478bab60f8847 (diff)
Update dmarcts-report-viewer.php
When arrays of data do not exist, for example in a new & empty set-up, create empty arrays Resolves the follow warnings and error: - Warning: Undefined variable $domains in /var/www/viewer/dmarcts-report-viewer.php on line 324 - Warning: Undefined variable $orgs in /var/www/viewer/dmarcts-report-viewer.php on line 325 - Warning: Undefined variable $periods in /var/www/viewer/dmarcts-report-viewer.php on line 326 - Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, null given in /var/www/viewer/dmarcts-report-viewer.php:125 Stack trace: #0 /var/www/viewer/dmarcts-report-viewer.php(326): html() #1 {main} thrown in /var/www/viewer/dmarcts-report-viewer.php on line 125
-rw-r--r--dmarcts-report-viewer.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/dmarcts-report-viewer.php b/dmarcts-report-viewer.php
index 180fee9..e6e32e4 100644
--- a/dmarcts-report-viewer.php
+++ b/dmarcts-report-viewer.php
@@ -309,6 +309,19 @@ while($row = $query->fetch_assoc()) {
$periods[] = sprintf( "%'.04d-%'.02d", $row['year'], $row['month'] );
}
+// When arrays of data do not exist, for example in a new & empty set-up, create empty arrays
+// --------------------------------------------------------------------------
+if(!isset($domains)){
+ $domains = array();
+}
+if(!isset($orgs)){
+ $orgs = array();
+}
+if(!isset($periods)){
+ $periods = array();
+}
+
+
// Generate Page with report list and report data (if a report is selected).
// --------------------------------------------------------------------------
echo html(