dedecms上传漏洞uploadsafe.inc.php,这里直接给出修复漏洞的方法,希望大家可以多学习。
今天分享的漏洞是一个关于织梦dedecms上传漏洞修复方法
打开/include/uploadsafe.inc.php文件
找到
${$_key.’_size’} = @filesize($$_key); }
改成
$ {$_key.'_size'}= @filesize($$_key);}$imtypes = array("image/pjpeg", "image/jpeg", "image/gif", "image/png", "image/xpng", "image/wbmp", "image/bmp");if(in_array(strtolower(trim($ {$_key.'_type'})), $imtypes)) {$image_dd = @getimagesize($$_key);if($image_dd == false) {continue;}if (!is_array($image_dd)) {exit('Upload filetype not allow !');}}
再找到
$image_dd = @getimagesize($$_key);
改成
$image_dd = @getimagesize($$_key); if($image_dd == false){ continue; }