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