From ff6d367101648e3207359f95cad371b9cd8e6315 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaime=20P=C3=A9rez=20Crespo?= <jaime.perez@uninett.no>
Date: Mon, 6 Jan 2014 19:06:12 +0000
Subject: [PATCH] Fix for issue #598 (bug in statistics aggregator)

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3317 44740490-163a-0410-bde0-09ae8108e29a
---
 modules/statistics/lib/Aggregator.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/statistics/lib/Aggregator.php b/modules/statistics/lib/Aggregator.php
index 2fe726ebe..423a33ad2 100644
--- a/modules/statistics/lib/Aggregator.php
+++ b/modules/statistics/lib/Aggregator.php
@@ -77,7 +77,9 @@ class sspmod_statistics_Aggregator {
 			throw new Exception('Statistics module: input file do not exists [' . $this->inputfile . ']');
 		
 		$file = fopen($this->inputfile, 'r');
-		#$logfile = file($this->inputfile, FILE_IGNORE_NEW_LINES );
+
+		if ($file === FALSE)
+			throw new Exception('Statistics module: unable to open file [' . $this->inputfile . ']');
 		
 		$logparser = new sspmod_statistics_LogParser(
 			$this->statconfig->getValue('datestart', 0), $this->statconfig->getValue('datelength', 15), $this->statconfig->getValue('offsetspan', 44)
-- 
GitLab