Skip to content

Commit

Permalink
Merge pull request #360 from FriendsOfCake/ADmad-patch-1
Browse files Browse the repository at this point in the history
Escape request params.
  • Loading branch information
ADmad authored Feb 23, 2022
2 parents b622d37 + 6fe6ddb commit 8fca5c2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
5 changes: 4 additions & 1 deletion templates/layout/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@
/**
* Default `body` block.
*/
$this->prepend('tb_body_attrs', ' class="' . implode(' ', [$this->request->getParam('controller'), $this->request->getParam('action')]) . '" ');
$this->prepend(
'tb_body_attrs',
' class="' . implode(' ', [h($this->request->getParam('controller')), h($this->request->getParam('action'))]) . '" '
);
if (!$this->fetch('tb_body_start')) {
$this->start('tb_body_start');
echo '<body' . $this->fetch('tb_body_attrs') . '>';
Expand Down
5 changes: 4 additions & 1 deletion templates/layout/examples/cover.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
use Cake\Core\Configure;

$this->Html->css('BootstrapUI.cover', ['block' => true]);
$this->prepend('tb_body_attrs', 'class="text-center ' . implode(' ', [$this->request->getParam('controller'), $this->request->getParam('action')]) . '" ');
$this->prepend(
'tb_body_attrs',
'class="text-center ' . implode(' ', [h($this->request->getParam('controller')), h($this->request->getParam('action'))]) . '" '
);

$this->start('tb_body_start'); ?>
<body <?= $this->fetch('tb_body_attrs') ?>>
Expand Down
7 changes: 5 additions & 2 deletions templates/layout/examples/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
use Cake\Core\Configure;

$this->Html->css('BootstrapUI.dashboard', ['block' => true]);
$this->prepend('tb_body_attrs', ' class="' . implode(' ', [$this->request->getParam('controller'), $this->request->getParam('action')]) . '" ');
$this->prepend(
'tb_body_attrs',
' class="' . implode(' ', [h($this->request->getParam('controller')), h($this->request->getParam('action'))]) . '" '
);
$this->start('tb_body_start');
?>
<body <?= $this->fetch('tb_body_attrs') ?>>
Expand All @@ -28,7 +31,7 @@
</div>
</nav>
<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
<h1 class="page-header"><?= $this->request->getParam('controller'); ?></h1>
<h1 class="page-header"><?= h($this->request->getParam('controller')) ?></h1>
<?php
/**
* Default `flash` block.
Expand Down
5 changes: 4 additions & 1 deletion templates/layout/examples/signin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
* @var \Cake\View\View $this
*/
$this->Html->css('BootstrapUI.signin', ['block' => true]);
$this->prepend('tb_body_attrs', ' class="' . implode(' ', [$this->request->getParam('controller'), $this->request->getParam('action')]) . '" ');
$this->prepend(
'tb_body_attrs',
' class="' . implode(' ', [h($this->request->getParam('controller')), h($this->request->getParam('action'))]) . '" '
);
$this->start('tb_body_start');
/**
* Default `flash` block.
Expand Down

0 comments on commit 8fca5c2

Please sign in to comment.