Skip to content
This repository has been archived by the owner on Oct 16, 2019. It is now read-only.

Commit

Permalink
* Bugfix: Hilfe wird unter PHP 7 nicht angezeigt
Browse files Browse the repository at this point in the history
* Bugfix: Mögliche XSS-Lücke in Template-Vorschau
  • Loading branch information
stefan committed Jan 15, 2018
1 parent 05a3ef4 commit c380d34
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
10 changes: 8 additions & 2 deletions inc/controller/action/system/help.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,18 @@ public function process() {
if (!parent::process()) return false;

$contents = $this->cache->read();
if ($this->cache->isExpired() || !is_array($contents)) {
if (!is_array($contents)) {
$contents = [];
}

if ($this->cache->isExpired()) {
$xml = simplexml_load_string($this->lang->getHelp());
foreach ($xml->chapter as $chapter) {
$headline = trim($chapter->headline);
$contents[$headline] = trim($chapter->text);
}
}

$this->cache->write($contents, FPCM_LANGCACHE_TIMEOUT);
}

$contents = $this->events->runEvent('extendHelp', $contents);
Expand Down
7 changes: 6 additions & 1 deletion inc/controller/action/system/templatepreview.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public function process() {
if (!parent::process()) return false;

$this->template = $this->getTemplateById($this->tid);

switch ($this->tid) {
case 1 :
$this->getArticlesPreview();
Expand Down Expand Up @@ -156,7 +157,11 @@ private function getArticlesPreview() {
$this->template->setReplacementTags($replacements);
$parsed[] = $this->template->parse();

$this->view->assign('content', implode(PHP_EOL, $parsed));
$this->view->assign('content', str_replace(
['<script>', '</script>'],
['&lt;script_diabled_in_preview&gt;', '&lt;/script_diabled_in_preview&gt;'],
implode(PHP_EOL, $parsed))
);
$this->view->assign('commentform', '');

}
Expand Down

0 comments on commit c380d34

Please sign in to comment.