Skip to content

Commit ea22788

Browse files
authored
Merge pull request #8706 from kenjis/fix-docs-alternative_php-sample
docs: add escaping to variables in sample code
2 parents 35809c5 + 78afe57 commit ea22788

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)