Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
<br>たとえば、ユーザーがhtmlタグを次のように配置したり<hr>、水平線や改行をそのまま表示しない場合に、コメントにhtmlタグが表示されないようにする方法を探していました(print out put <br> or <hr>:)
<br>
<hr>
<br> or <hr>
htmlspecialchars()これを防ぐために使用する必要があります。これにより、 XSS攻撃も防止されます。
htmlspecialchars()
http://codepad.viper-7.com/w5U8qs