Skip to content

Commit 8fca5c2

Browse files
authored
Merge pull request #360 from FriendsOfCake/ADmad-patch-1
Escape request params.
2 parents b622d37 + 6fe6ddb commit 8fca5c2

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

templates/layout/default.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@
4343
/**
4444
* Default `body` block.
4545
*/
46-
$this->prepend('tb_body_attrs', ' class="' . implode(' ', [$this->request->getParam('controller'), $this->request->getParam('action')]) . '" ');
46+
$this->prepend(
47+
'tb_body_attrs',
48+
' class="' . implode(' ', [h($this->request->getParam('controller')), h($this->request->getParam('action'))]) . '" '
49+
);
4750
if (!$this->fetch('tb_body_start')) {
4851
$this->start('tb_body_start');
4952
echo '<body' . $this->fetch('tb_body_attrs') . '>';

templates/layout/examples/cover.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
use Cake\Core\Configure;
66

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

1013
$this->start('tb_body_start'); ?>
1114
<body <?= $this->fetch('tb_body_attrs') ?>>

templates/layout/examples/dashboard.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
use Cake\Core\Configure;
66

77
$this->Html->css('BootstrapUI.dashboard', ['block' => true]);
8-
$this->prepend('tb_body_attrs', ' class="' . implode(' ', [$this->request->getParam('controller'), $this->request->getParam('action')]) . '" ');
8+
$this->prepend(
9+
'tb_body_attrs',
10+
' class="' . implode(' ', [h($this->request->getParam('controller')), h($this->request->getParam('action'))]) . '" '
11+
);
912
$this->start('tb_body_start');
1013
?>
1114
<body <?= $this->fetch('tb_body_attrs') ?>>
@@ -28,7 +31,7 @@
2831
</div>
2932
</nav>
3033
<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
31-
<h1 class="page-header"><?= $this->request->getParam('controller'); ?></h1>
34+
<h1 class="page-header"><?= h($this->request->getParam('controller')) ?></h1>
3235
<?php
3336
/**
3437
* Default `flash` block.

templates/layout/examples/signin.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
* @var \Cake\View\View $this
44
*/
55
$this->Html->css('BootstrapUI.signin', ['block' => true]);
6-
$this->prepend('tb_body_attrs', ' class="' . implode(' ', [$this->request->getParam('controller'), $this->request->getParam('action')]) . '" ');
6+
$this->prepend(
7+
'tb_body_attrs',
8+
' class="' . implode(' ', [h($this->request->getParam('controller')), h($this->request->getParam('action'))]) . '" '
9+
);
710
$this->start('tb_body_start');
811
/**
912
* Default `flash` block.

0 commit comments

Comments
 (0)