Skip to content
Permalink
Browse files

[statistics] Add extra validation (#357)

  • Loading branch information...
harold20 authored and enzolutions committed Jun 18, 2019
1 parent 563c08b commit e2f04388ba85d441f18f77102b16049addc01718
Showing with 14 additions and 4 deletions.
  1. +7 −2 src/EventSubscriber/SaveStatisticsListener.php
  2. +7 −2 src/EventSubscriber/SendStatisticsListener.php
@@ -74,8 +74,13 @@ public function saveStatistics(ConsoleTerminateEvent $event)
$configGlobalAsArray = $this->configurationManager->getConfigGlobalAsArray();
//Validate if the config is enable.
if (is_null($configGlobalAsArray) || !$configGlobalAsArray['application']['statistics']['enabled']) {
//Validate if the config is defined.
if (is_null($configGlobalAsArray) || !isset($configGlobalAsArray['application']['statistics'])) {
return;
}
//Validate if the statistics is enabled.
if (!isset($configGlobalAsArray['application']['statistics']['enabled']) || !$configGlobalAsArray['application']['statistics']['enabled']) {
return;
}
@@ -67,8 +67,13 @@ public function calculateStatistics(ConsoleTerminateEvent $event)
$date = date('Y-m-d');
$configGlobalAsArray = $this->configurationManager->getConfigGlobalAsArray();
//Validate if the config is enable.
if (is_null($configGlobalAsArray) || !$configGlobalAsArray['application']['statistics']['enabled']) {
//Validate if the config is defined.
if (is_null($configGlobalAsArray) || !isset($configGlobalAsArray['application']['statistics'])) {
return;
}
//Validate if the statistics is enabled.
if (!isset($configGlobalAsArray['application']['statistics']['enabled']) || !$configGlobalAsArray['application']['statistics']['enabled']) {
return;
}

0 comments on commit e2f0438

Please sign in to comment.
You can’t perform that action at this time.