Skip to content

Commit 0e0bcf9

Browse files
committed
4.47 release
1 parent baf467e commit 0e0bcf9

33 files changed

Lines changed: 67 additions & 63 deletions

File tree

app/controller/utils.php

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

app/function/helper.function.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ function checkExt($file){
2727
}
2828
return 1;
2929
}
30+
function checkExtSafe($file){
31+
if($file == '.htaccess' || $file == '.user.ini') return false;
32+
if (strstr($file,'<') || strstr($file,'>') || $file=='') return false;
33+
$disable = 'php|phtml|phtm|pwml|asp|aspx|ascx|jsp|pl|html|htm|svg|shtml|shtm';
34+
$extArr = explode('|',$disable);
35+
foreach ($extArr as $ext) {
36+
if ($ext && stristr($file,'.'.$ext)) return false;
37+
}
38+
return true;
39+
}
3040

3141
//-----解压缩跨平台编码转换;自动识别编码-----
3242
//压缩前,文件名处理;

app/kod/Downloader.class.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,6 @@ static function fileDownloadFopen($url, $fileName,$headerSize=0){
100100
//下载完成,重命名临时文件到目标文件
101101
fclose($downloadFp);
102102
fclose($fp);
103-
104-
$filesize = get_filesize(iconv_system($fileTemp));
105-
if($headerSize != 0 && $filesize != $headerSize){
106-
return array('code'=>false,'data'=>'file size error');
107-
}
108103
self::checkGzip($fileTemp);
109104
if(!@rename($fileTemp,$fileName)){
110105
usleep(round(rand(0,1000)*50));//0.01~10ms
@@ -145,11 +140,6 @@ static function fileDownloadCurl($url, $fileName,$supportRange=false,$existsLeng
145140
if($filesize < $length && $length!=0){
146141
return array('code'=>false,'data'=>'downloading');
147142
}
148-
if($filesize > $length && $length!=0){
149-
//远程下载大小不匹配;则返回正在下载中,客户端重新触发下载
150-
return array('code'=>false,'data'=>'file size error');
151-
}
152-
153143
if($res && filesize($fileTemp) != 0){
154144
self::checkGzip($fileTemp);
155145
if(!@rename($fileTemp,$fileName)){

app/kod/PluginBase.class.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ final function filePath($path){
7979
show_json(LNG('url error!'),false);
8080
}
8181
$cacheName = md5($path.'kodcloud').'.'.get_path_ext($path);
82-
$cacheFile = TEMP_PATH.$this->pluginName.'/files/'.$cacheName;
82+
$cacheFile = $this->filePathName($cacheName);
8383
mk_dir(get_path_father($cacheFile));
8484
if(!file_exists($cacheFile)){
8585
$result = url_request($path,'DOWNLOAD',$cacheFile);
@@ -92,8 +92,8 @@ final function filePath($path){
9292
version_compare(phpversion(), '7.1.0', '>=') &&
9393
preg_match("/([\x81-\xfe][\x40-\xfe])/", $path, $match)){
9494

95-
$name = hash_path($path).'.'.get_path_ext($path);
96-
$cacheFile = TEMP_PATH.$this->pluginName.'/files/'.$name;
95+
$cacheName = hash_path($path).'.'.get_path_ext($path);
96+
$cacheFile = $this->filePathName($cacheName);
9797
mk_dir(get_path_father($cacheFile));
9898
if(!file_exists($cacheFile)){
9999
@copy($path,$cacheFile);
@@ -106,6 +106,10 @@ final function filePath($path){
106106
}
107107
return $path;
108108
}
109+
private function filePathName($fileName){
110+
if(! checkExtSafe($fileName)){$fileName = $fileName.'.txt';}
111+
return TEMP_PATH.$this->pluginName.'/files/'.$fileName;
112+
}
109113

110114
/**
111115
* 插件配置数据加载

config/version.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<?php
2-
define('KOD_VERSION','4.46');
3-
define('KOD_VERSION_BUILD','0714');//time(),0409
2+
define('KOD_VERSION','4.47');
3+
define('KOD_VERSION_BUILD','1228');//time(),0409

plugins/toolsCommon/static/pie/.pie.tif

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

static/js/app/src/api/default/main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/js/app/src/api/view/main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/js/app/src/app/main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/js/app/src/desktop/main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)