Delete inline style for phpinfo
https://github.com/forkbb/forkbb/issues/2
This commit is contained in:
parent
2f6a8c8c1e
commit
3a9ebb5336
2 changed files with 30 additions and 1 deletions
|
@ -538,6 +538,12 @@ class Routing
|
|||
'AdminStatistics:info',
|
||||
'AdminInfo'
|
||||
);
|
||||
$r->add(
|
||||
$r::GET,
|
||||
'/admin/statistics/info/{time:\d+}',
|
||||
'AdminStatistics:infoCSS',
|
||||
'AdminInfoCSS'
|
||||
);
|
||||
$r->add(
|
||||
$r::DUO,
|
||||
'/admin/options',
|
||||
|
|
|
@ -49,7 +49,12 @@ class Statistics extends Admin
|
|||
},
|
||||
$matches[1]
|
||||
);
|
||||
$this->pageHeader('phpinfo', 'style', [$style]);
|
||||
$this->c->Cache->set('phpinfoCSS', $style);
|
||||
$this->pageHeader('phpinfoStyle', 'link', [
|
||||
'rel' => 'stylesheet',
|
||||
'type' => 'text/css',
|
||||
'href' => $this->c->Router->link('AdminInfoCSS', ['time' => \time()] ),
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
$phpinfo = '- - -';
|
||||
|
@ -70,6 +75,24 @@ class Statistics extends Admin
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Возврат css из phpinfo() как файл
|
||||
*/
|
||||
public function infoCSS(): Page
|
||||
{
|
||||
$this->c->DEBUG = 0;
|
||||
|
||||
$this->nameTpl = 'layouts/plain';
|
||||
$this->plainText = $this->c->Cache->get('phpinfoCSS', '');
|
||||
# $this->onlinePos = null;
|
||||
$this->onlineDetail = false;
|
||||
$this->onlineFilter = false;
|
||||
|
||||
$this->header('Content-type', 'text/css; charset=utf-8');
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Подготавливает данные для шаблона
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue