diff --git a/config/config.php b/config/config.php index eb812cc..03d2f78 100755 --- a/config/config.php +++ b/config/config.php @@ -97,7 +97,7 @@ if (strtoupper(substr(PHP_OS, 0,3)) === 'WIN') { } $in = parse_incoming(); -session_start(); +@session_start(); session_write_close();//避免session锁定问题;之后要修改$_SESSION 需要先调用session_start() $config['autorun'] = array( array('controller'=>'user','function'=>'loginCheck'), diff --git a/controller/explorer.class.php b/controller/explorer.class.php index c7ad34d..9e694d2 100755 --- a/controller/explorer.class.php +++ b/controller/explorer.class.php @@ -101,9 +101,12 @@ class explorer extends Controller{ } //回收站不记录前进后退 - if($this->in['path'] != '*recycle*/' && $this->in['type'] !=='desktop'){ - $_SESSION['this_path']=$user_path; + if (isset($this->in['type'])){ + if($this->in['path'] != '*recycle*/' && $this->in['type'] !=='desktop'){ + $_SESSION['this_path']=$user_path; + } } + $list=$this->path($this->path); $list['history_status']= array('back'=>$hi->isback(),'next'=>$hi->isnext()); show_json($list); @@ -254,7 +257,7 @@ class explorer extends Controller{ } $state = $error==0?true:false; $info = $success.' success,'.$error.' error'; - if (count($info_list) == 1 && $error==0) { + if ($error==0) { $info = $this->L['remove_success']; } show_json($info,$state); @@ -391,7 +394,7 @@ class explorer extends Controller{ } public function pathPast(){ if (!isset($_SESSION['path_copy'])){ - show_json($this->L['clipboard_null'],false,$data); + show_json($this->L['clipboard_null'],false,array()); } session_start();//re start diff --git a/lib/function/file.function.php b/lib/function/file.function.php index 75ab376..af6f2a0 100755 --- a/lib/function/file.function.php +++ b/lib/function/file.function.php @@ -50,8 +50,9 @@ function iconv_system($str){ } function get_filesize($path){ - return abs(sprintf("%u",filesize($path))); -} + // 某些情况下filesize会出错 + @$ret = abs(sprintf("%u",filesize($path))); + return (int)$ret;} /** * 获取文件详细信息 * 文件名从程序编码转换成系统编码,传入utf8,系统函数需要为gbk @@ -130,7 +131,7 @@ function get_path_ext($path){ //自动获取不重复文件(夹)名 //如果传入$file_add 则检测存在则自定重命名 a.txt 为a{$file_add}.txt -function get_filename_auto($path,$file_add){ +function get_filename_auto($path,$file_add = ""){ $i=1; $father = get_path_father($path); $name = get_path_this($path); @@ -291,7 +292,8 @@ function path_haschildren($dir,$check_file=false){ if ($check_file) {//有子目录或者文件都说明有子内容 if(is_dir($fullpath.'/') || is_file($fullpath)) return true; }else{//只检查有没有文件 - if(is_dir($fullpath.'/')) return true; + @$ret =(is_dir($fullpath.'/')); + return (bool)$ret; } } } @@ -628,8 +630,8 @@ function file_download_this($from, $file_name){ } //下载完成,重命名临时文件到目标文件 del_file($file_name); - rename($temp_file,$file_name); - return true; + $rename_ret = @rename($temp_file,$file_name); + return (bool)$rename_ret; }else{ return false; } diff --git a/template/editor/edit.php b/template/editor/edit.php index 8d71646..5ea7706 100755 --- a/template/editor/edit.php +++ b/template/editor/edit.php @@ -89,7 +89,7 @@ http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">