php没有好的逃脱 [英] php no good escape
本文介绍了php没有好的逃脱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个这样的脚本:
document.getElementById('debugLayer').innerHTML = '<?php foreach (self::$errorLogs as $item) { echo htmlentities ($item, ENT_QUOTES).'<hr />'; } ?>';
其中$ errorLogs是列表的数组。但是它一定不能正确逃脱,因为firefox这样说:
where $errorLogs is an array of list. But it must have not escape correctly, since firefox say to this:
Error: malformed Unicode character escape sequence
Source File: X
Line: 553, Column: 63
Source Code:
document.getElementById('debugLayerDIVcontent_10').innerHTML = '<span style="background-color:yellow;"><i>Missing argument 3 for Upload::getDamagesStatisticsByUserID(), called in action_index.php on line 149 and defined</i></span>, in <span style="background-color:#40FF40;"><b>Upload.php</b></span> at <i><span style="background-color:red; color:white;">256</span></i> [<b>2</b>]<hr /><span style="background-color:yellow;"><i>Undefined variable: join</i></span>, in <span style="background-color:#40FF40;"><b>Upload.php</b></span> at <i><span style="background-color:red; color:white;">266</span></i> [<b>8</b>]<hr />';
可能有什么问题?
推荐答案
htmlentities()
接受第三个参数来定义使用的字符集。默认值为Latin1,当您使用UTF-8
htmlentities()
accepts a 3rd argument to define the used charset. The default is Latin1, set it to UTF-8 when you're using UTF-8
这篇关于php没有好的逃脱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文