回答編集履歴
2
ミスがあったため修正。
answer
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
```PHP
|
|
2
|
-
<script>alert(<?php echo
|
|
2
|
+
<script>alert(<?php echo $sample; ?>)</script>
|
|
3
|
-
```
|
|
3
|
+
```
|
|
4
|
-
|
|
5
|
-
【「何故htmlspecialcharsを通すのか?」を一言でどうぞ - Qiita】
|
|
6
|
-
[https://qiita.com/mpyw/items/19e6fed835ccdbcb0d6d](https://qiita.com/mpyw/items/19e6fed835ccdbcb0d6d)
|
1
ミスがあったため修正。
answer
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
```PHP
|
|
2
|
-
<script>alert(<?php echo $sample;?>)</script>
|
|
2
|
+
<script>alert(<?php echo htmlspecialchars( $sample, ENT_QUOTES, 'UTF-8' );?>)</script>
|
|
3
|
-
```
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
【「何故htmlspecialcharsを通すのか?」を一言でどうぞ - Qiita】
|
|
6
|
+
[https://qiita.com/mpyw/items/19e6fed835ccdbcb0d6d](https://qiita.com/mpyw/items/19e6fed835ccdbcb0d6d)
|