修复coolcode Version3.4 插件中html代码被执行的BUG

用了coolcode插件,发现好多含有HTML代码的文章被执行了! 很郁闷的事情,到该插件的官方看了一下,貌似没有被修复! google了一下,找到了方法!
忘记在哪位仁兄的BLOG上看到方法的了!抱歉了啊!

压缩包内的quicktags.js文件直接覆盖到 wp-includes/js/ 下即可,后台添加文章部份就有coolcode的标签了!
coolcode.php直接覆盖原来的coolcode.php即可!!其中 Coolcode为3.4 Version….WordPress2.31通过! 其他版本不知道! 大家自己修改!

coolcode.php中的貌似316行附近
$hl =& Text_Highlighter::factory($lang, $options);
$this->blocks[$blockID] .= '<div class="hl-surround">' . str_replace($this->hl_class, $this->hl_style, $hl->highlight(htmlspecialchars_decode($txt))) . '</div>';
coolcode.php中的貌似327行附近
$hl =& Text_Highlighter::factory($lang, $options);
$this->blocks[$blockID] .= '<div class="hl-surround">' . str_replace($this->hl_class, $this->hl_style, $hl->highlight(htmlspecialchars_decode($txt))) . '</div>';
coolcode.php中的貌似351行附近
$hl =& Text_Highlighter::factory($lang);
$this->blocks[$blockID] .= '<div class="hl-surround">' . str_replace("\n", "<br />", str_replace("</pre>", "", str_replace("<pre>", "", str_replace($this->hl_class, $this->hl_style, $hl->highlight(htmlspecialchars_decode($txt)))))) . '</div>';
coolcode.php中的貌似82行附近
echo trim(html_entity_decode($match[3]));

附件在这里啊,附件在这里!!!!!
CCode+JS.rar

随机日志

发表评论

0 评论.

Leave a Reply



[ Ctrl + Enter ]

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

CNXCT小组的博客 is Stephen Fry proof thanks to caching by WP Super Cache