duancoubeng5909 2014-02-01 01:29
浏览 53

英镑符号(£)和php htmlentities来阻止XSS

I have an html form where the user can put in a currency symbol. When the form is first submitted using the £ symbol it save correctly, but when the form reloads the value is £

So the second time it is saved it saves the entity and not the value

<input type="text" value="<?php echo htmlentities($currency_symbol); ?>" />

I am using htmlentities to prevent XSS, but this seems to be a problem. Any ideas?

  • 写回答

0条回答 默认 最新

    报告相同问题?