Skip to content

Commit 78afe57

Browse files
committed
docs: add escaping to variables
It is bad practice to output variables without escaping in HTML.
1 parent 9bf27a1 commit 78afe57

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

user_guide_src/source/outgoing/alternative_php.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ Alternative Echos
1515

1616
Normally to echo, or print out a variable you would do this::
1717

18-
<?php echo $variable; ?>
18+
<?php echo esc($variable); ?>
1919

2020
With the alternative syntax you can instead do it this way::
2121

22-
<?= $variable ?>
22+
<?= esc($variable) ?>
2323

2424
Alternative Control Structures
2525
==============================

user_guide_src/source/outgoing/alternative_php/001.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<?php foreach ($todo as $item): ?>
44

5-
<li><?= $item ?></li>
5+
<li><?= esc($item) ?></li>
66

77
<?php endforeach ?>
88

0 commit comments

Comments
 (0)