I am using Codeingiter, I see that the xss_clean() is replacing the tab characters with a single space character. This is breaking the contents that are later displayed inside <pre><code></code></pre> tags.
Can XSS attack string inside <code> HTML tag be of any problem?
If yes, is there a way to retain the tabs in such a situation?
Yes, XSS attacks within the
<code>element are still a problem. To get around this, you should escape your code within the<code>block. e.g.Which will display as: