1
0
mirror of https://github.com/flarum/core.git synced 2025-08-04 23:47:32 +02:00

Prevent statistics from being loaded outside of admin

closes flarum/core#1311
This commit is contained in:
Toby Zerner
2017-12-19 08:52:13 +10:30
parent d56b792a9d
commit d827fd36fe

View File

@@ -49,11 +49,13 @@ class AddStatisticsData
*/
public function addStatisticsData(ConfigureWebApp $event)
{
if ($event->isAdmin()) {
$event->view->setVariable('statistics', array_merge(
$this->getStatistics(),
['utcOffset' => $this->getUTCOffset()]
['timezoneOffset' => $this->getUserTimezone()->getOffset(new DateTime)]
));
}
}
private function getStatistics()
{