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:
@@ -49,10 +49,12 @@ class AddStatisticsData
|
||||
*/
|
||||
public function addStatisticsData(ConfigureWebApp $event)
|
||||
{
|
||||
$event->view->setVariable('statistics', array_merge(
|
||||
$this->getStatistics(),
|
||||
['utcOffset' => $this->getUTCOffset()]
|
||||
));
|
||||
if ($event->isAdmin()) {
|
||||
$event->view->setVariable('statistics', array_merge(
|
||||
$this->getStatistics(),
|
||||
['timezoneOffset' => $this->getUserTimezone()->getOffset(new DateTime)]
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
private function getStatistics()
|
||||
|
Reference in New Issue
Block a user