mirror of
https://github.com/flarum/framework.git
synced 2025-03-15 00:05:12 +08:00
Prevent statistics from being loaded outside of admin
closes flarum/core#1311
This commit is contained in:
parent
d56b792a9d
commit
d827fd36fe
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user