Skip to content

Commit 4d8266d

Browse files
committed
docs: add esc() to views
It is not good practice to show variables without escaping
1 parent 775f50c commit 4d8266d

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

user_guide_src/source/outgoing/views.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,10 @@ Now open your view file and change the text to variables that correspond to the
163163

164164
<html>
165165
<head>
166-
<title><?= $title ?></title>
166+
<title><?= esc($title) ?></title>
167167
</head>
168168
<body>
169-
<h1><?= $heading ?></h1>
169+
<h1><?= esc($heading) ?></h1>
170170
</body>
171171
</html>
172172

@@ -220,17 +220,17 @@ Now open your view file and create a loop::
220220

221221
<html>
222222
<head>
223-
<title><?= $title ?></title>
223+
<title><?= esc($title) ?></title>
224224
</head>
225225
<body>
226-
<h1><?= $heading ?></h1>
226+
<h1><?= esc($heading) ?></h1>
227227

228228
<h3>My Todo List</h3>
229229

230230
<ul>
231231
<?php foreach ($todo_list as $item):?>
232232

233-
<li><?= $item ?></li>
233+
<li><?= esc($item) ?></li>
234234

235235
<?php endforeach;?>
236236
</ul>

0 commit comments

Comments
 (0)