Skip to content

Commit 5cf233f

Browse files
committed
4.52 release
1 parent dfb3597 commit 5cf233f

File tree

14 files changed

+36
-47
lines changed

14 files changed

+36
-47
lines changed

Diff for: ChangeLog.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### ver4.52 `2023/12/15`
2+
- 安全问题修复
3+
14
### ver4.51 `2023/4/6`
25
- 兼容性调整
36

Diff for: app/controller/api.class.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ private function setIdentify(){
3535
public function checkAccessToken(){
3636
$model = $this->loadModel('Plugin');
3737
$config = $model->getConfig('fileView');
38-
if(!$config['apiKey']){
39-
return;
38+
if(!$config || !$config['apiKey']){
39+
show_tips('fileView not open ,or apiKey is empty!');
4040
}
4141
$timeTo = isset($this->in['timeTo'])?intval($this->in['timeTo']):'';
4242
$token = md5($config['apiKey'].$this->in['path'].$timeTo);

Diff for: app/controller/utils.php

+1-1
Large diffs are not rendered by default.

Diff for: app/function/file.function.php

+5-9
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ function iconv_system($str){
5151
return $result;
5252
}
5353
function iconv_to($str,$from,$to){
54+
if(!$from || !$to) return $str;
5455
if (strtolower($from) == strtolower($to)){
5556
return $str;
5657
}
@@ -249,14 +250,9 @@ function get_path_father($path){
249250
function get_path_ext($path){
250251
$name = get_path_this($path);
251252
$ext = '';
252-
if(strstr($name,'.')){
253-
$ext = substr($name,strrpos($name,'.')+1);
254-
$ext = strtolower($ext);
255-
}
256-
if (strlen($ext)>3 && preg_match("/([\x81-\xfe][\x40-\xfe])/", $ext, $match)) {
257-
$ext = '';
258-
}
259-
return htmlspecialchars($ext);
253+
if(strstr($name,'.')){$ext = substr($name,strrpos($name,'.')+1);}
254+
$isMatch = preg_match("/[0-9a-zA-Z_]+/",$ext,$match);// 只允许数字字母和下划线
255+
return ($isMatch && $match[0]) ? strtolower($match[0]):'';
260256
}
261257

262258

@@ -1011,7 +1007,7 @@ function file_put_out($file,$download=-1,$downFilename=false){
10111007
header('Content-Disposition: attachment;filename='.$headerName);
10121008
}else{
10131009
header('Content-Type: '.$mime);
1014-
header('Content-Disposition: inline;filename='.$headerName);
1010+
//header('Content-Disposition: inline;filename='.$headerName);
10151011
if(strstr($mime,'text/')){
10161012
//$charset = get_charset(file_get_contents($file));
10171013
header('Content-Type: '.$mime.'; charset=');//避免自动追加utf8导致gbk网页乱码

Diff for: app/function/helper.function.php

+6-15
Original file line numberDiff line numberDiff line change
@@ -456,21 +456,12 @@ function hash_path($path,$addExt=false){
456456
$password = $GLOBALS['config']['settingSystem']['systemPassword'];
457457
}
458458

459-
$pre = substr(md5($path.$password),0,8);
460-
$result = $pre.md5($path);
461-
if(file_exists($path)){
462-
$result = $pre.md5($path.filemtime($path));
463-
if(filesize($path) < 50*1024*1024){
464-
$fileMd5 = @md5_file($path);
465-
if($fileMd5){
466-
$result = $fileMd5;
467-
}
468-
}
469-
}
470-
if($addExt){
471-
$result = $result.'.'.get_path_ext($path);
472-
}
473-
return $result;
459+
$pre = substr(md5('kod-system'.$password),0,8);
460+
$result = md5($path);
461+
if(file_exists($path)){$result = file_hash_simple($path);}
462+
if($addExt){$result = $result.'.'.get_path_ext($path);}
463+
464+
return $pre.$result;
474465
}
475466

476467

Diff for: app/kod/ImageThumb.class.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,7 @@ function distortion($toFile, $toW, $toH){
9090
}
9191
// 生成按比例缩放的缩图
9292
function prorate($toFile, $toW, $toH){
93-
if(!$this->im){
94-
return false;
95-
}
93+
if(!$this->im){return false;}
9694
$toWH = $toW / $toH;
9795
$srcWH = $this->srcW / $this->srcH;
9896
if ($toWH<=$srcWH) {
@@ -112,6 +110,7 @@ function prorate($toFile, $toW, $toH){
112110
}
113111
// 生成最小裁剪后的缩图
114112
function cut($toFile, $toW, $toH){
113+
if(!$this->im){return false;}
115114
$toWH = $toW / $toH;
116115
$srcWH = $this->srcW / $this->srcH;
117116
if ($toWH<=$srcWH) {

Diff for: app/sdks/lessc.class.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ protected function compileProp($prop, $block, $out) {
714714
if ($suffix !== null &&
715715
$subProp[0] == "assign" &&
716716
is_string($subProp[1]) &&
717-
$subProp[1]{0} != $this->vPrefix)
717+
$subProp[1][0] != $this->vPrefix)
718718
{
719719
$subProp[2] = array(
720720
'list', ' ',
@@ -1765,7 +1765,7 @@ protected function injectVariables($args) {
17651765
$this->pushEnv();
17661766
$parser = new lessc_parser($this, __METHOD__);
17671767
foreach ($args as $name => $strValue) {
1768-
if ($name{0} != '@') $name = '@'.$name;
1768+
if ($name[0] != '@') $name = '@'.$name;
17691769
$parser->count = 0;
17701770
$parser->buffer = (string)$strValue;
17711771
if (!$parser->propertyValue($value)) {
@@ -2421,7 +2421,7 @@ protected function parseChunk() {
24212421
$hidden = true;
24222422
if (!isset($block->args)) {
24232423
foreach ($block->tags as $tag) {
2424-
if (!is_string($tag) || $tag{0} != $this->lessc->mPrefix) {
2424+
if (!is_string($tag) || $tag[0] != $this->lessc->mPrefix) {
24252425
$hidden = false;
24262426
break;
24272427
}
@@ -2475,7 +2475,7 @@ protected function isDirective($dirname, $directives) {
24752475
protected function fixTags($tags) {
24762476
// move @ tags out of variable namespace
24772477
foreach ($tags as &$tag) {
2478-
if ($tag{0} == $this->lessc->vPrefix)
2478+
if ($tag[0] == $this->lessc->vPrefix)
24792479
$tag[0] = $this->lessc->mPrefix;
24802480
}
24812481
return $tags;

Diff for: config/version.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<?php
2-
define('KOD_VERSION','4.51');
3-
define('KOD_VERSION_BUILD','02');//time(),20230330
2+
define('KOD_VERSION','4.52');
3+
define('KOD_VERSION_BUILD','01');//time(),20231212

Diff for: plugins/toolsCommon/static/pie/.pie.tif

+1-1
Large diffs are not rendered by default.

Diff for: static/style/skin/base/app_code_edit.css

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: static/style/skin/base/app_desktop.css

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: static/style/skin/base/app_editor.css

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: static/style/skin/base/app_explorer.css

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: static/style/skin/base/app_setting.css

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)