From 24c50487d22af9e7555024640debde17a6d7446b Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Tue, 3 Jun 2014 15:37:58 +0000 Subject: [PATCH] Fix bug with undefined "$start" variable in StatisticsController --- .../libs/classes/Mibew/Controller/StatisticsController.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mibew/libs/classes/Mibew/Controller/StatisticsController.php b/src/mibew/libs/classes/Mibew/Controller/StatisticsController.php index 21870f02..3af3e4be 100644 --- a/src/mibew/libs/classes/Mibew/Controller/StatisticsController.php +++ b/src/mibew/libs/classes/Mibew/Controller/StatisticsController.php @@ -181,9 +181,12 @@ class StatisticsController extends AbstractController $year = $curr['year']; } + $start = mktime(0, 0, 0, $month, 1, $year); + $end = mktime(0, 0, 0, $month, date('t', $start), $year) + 24 * 60 * 60; + return array( - 'start' => mktime(0, 0, 0, $month, 1, $year), - 'end' => mktime(0, 0, 0, $month, date('t', $start), $year) + 24 * 60 * 60, + 'start' => $start, + 'end' => $end, ); }