@@ -57,14 +57,14 @@ When using the `\Magento\Framework\Escaper` or `$escaper`:
57
57
** The following code sample illustrates XSS-safe output in templates:**
58
58
59
59
``` php
60
- <?php echo $block->getTitleHtml() ?>
61
- <?php echo $block->getHtmlTitle() ?>
62
- <?php echo $escaper->escapeHtml($block->getTitle()) ?>
63
- <?php echo (int)$block->getId() ?>
64
- <?php echo count($var); ?>
65
- <?php echo 'some text' ?>
66
- <?php echo "some text" ?>
67
- <a href =" <?php echo $escaper->escapeUrl($block->getUrl()) ?>" ><?php echo $block->getAnchorTextHtml() ?></a >
60
+ <?= $block->getTitleHtml() ?>
61
+ <?= $block->getHtmlTitle() ?>
62
+ <?= $escaper->escapeHtml($block->getTitle()) ?>
63
+ <?= (int)$block->getId() ?>
64
+ <?= count($var); ?>
65
+ <?= 'some text' ?>
66
+ <?= "some text" ?>
67
+ <a href =" <?= $escaper->escapeUrl($block->getUrl()) ?>" ><?= $block->getAnchorTextHtml() ?></a >
68
68
```
69
69
70
70
** When to use Escaper methods:**
@@ -98,10 +98,10 @@ If a tag is allowed, the following attributes will not be escaped: `id`, `class`
98
98
` embed` , ` iframe` , ` video` , ` source` , ` object` , ` audio` , ` script` and ` img` tags are not allowed, regardless of the content of this array.
99
99
100
100
` ` ` php
101
- < span class = " label" >< ? php echo $escaper- > escapeHtml ($block- > getLabel ()) ? >< / span>
101
+ < span class = " label" >< ? = $escaper- > escapeHtml ($block- > getLabel ()) ? >< / span>
102
102
// Escaping translation
103
103
< div id= ' my-element' >
104
- < ? php echo $escaper- > escapeHtml (__ (' Only registered users can write reviews. Please <a href="%1">Sign in</a> or <a href="%2">create an account</a>' , $block- > getLoginUrl (), $block- > getCreateAccountUrl ()), [' a' ]) ? >
104
+ < ? = $escaper- > escapeHtml (__ (' Only registered users can write reviews. Please <a href="%1">Sign in</a> or <a href="%2">create an account</a>' , $block- > getLoginUrl (), $block- > getCreateAccountUrl ()), [' a' ]) ? >
105
105
< / div>
106
106
` ` `
107
107
0 commit comments