织梦DedeCMS投票模块漏洞的解决方法 。
我们找到并打开/include/dedevote.class.php文件,在里面查找如下代码:
$this->dsql->ExecuteNoneQuery(“UPDATE `#【分隔符】@__vote` SET totalcount='”.($this->VoteInfos[‘totalcount’]+1).”‘,votenote='”.addslashes($items).”‘ WHERE aid='”.$this->VoteID.”‘”);
修改为如下代码:
$this->dsql->ExecuteNoneQuery(“UPDATE `#【分隔符】@__vote` SET totalcount='”.($this->VoteInfos[‘totalcount’]+1).”‘,votenote='”.mysql_real_escape_string($items).”‘ WHERE aid='”.mysql_real_escape_string($this->VoteID).”‘”);
注:
1.复制的时候自行去掉里面的【分隔符】 。
2.addslashes()的意思是强行加\;
3.mysql_real_escape_string() 会判断字符集,但是对PHP版本有要求;(PHP 4 >= 4.0.3, PHP 5) ,
4.mysql_escape_string不考虑连接的当前字符集。(PHP 4 >= 4.0.3, PHP 5, 注意:在PHP5.3中已经弃用这种方法,不推荐使用) 。
(责任编辑:好模板) |


丽人坊化妆品ecshop模板
人气:539
织梦dedecms绿色节能科技公
人气:1349
ecshop英文鞋子模板
人气:723
仿乐蜂网化妆品商城模板
人气:736
ecshop精仿京东商城模板2
人气:1362
Ecmall仿天猫2014多店铺商城
人气:2515