${KOD_VERSION} release
parent
f5bcdaddf4
commit
ab6361bff9
15
ChangeLog.md
15
ChangeLog.md
|
@ -1,3 +1,14 @@
|
|||
|
||||
|
||||
### ver4.45 `2021/04/07`
|
||||
- 更新检测文件多种引入方式;
|
||||
- php7.4,php8兼容
|
||||
- x-senffile 下载加速支持
|
||||
- 对话框打开url; https协议不同时新窗口打开;
|
||||
- 上传合并优化加速处理;
|
||||
- 解压 构造漏洞修复;
|
||||
后端加密方式优化
|
||||
|
||||
### ver4.40 `2019/3/21`
|
||||
-----
|
||||
#### update:
|
||||
|
@ -831,7 +842,7 @@
|
|||
- 新建office文档;office文档预览(所有支持的列表);内网实现预览(服务端转换——pdf)
|
||||
- 虚拟目录多选操作右键菜单:收藏夹;我所在的组、全部组;我的共享
|
||||
- 虚拟目录选中(多选)快捷键操作:屏蔽删除、复制、剪切、重命名
|
||||
- 文件图标排列时,高度自适应,文件名最高四行文字
;(桌面特殊处理);拖动到指定文件夹放大效果
|
||||
- 文件图标排列时,高度自适应,文件名最高四行文字;(桌面特殊处理);拖动到指定文件夹放大效果
|
||||
- xxs问题优化:文件名特殊处理,对应地址栏、树目录、重命名展示、分享等展示的地方统一做处理
|
||||
- 新建文件,重命名文件;(icon,自动高度后 优化;图标和列表模式)
|
||||
- 不同类型目录之间切换:单选、多选;右键菜单还原(目录、回收站、分享目录、收藏夹、所有群组、我的群组等)
|
||||
|
@ -1000,7 +1011,7 @@
|
|||
- 全局字体调整;用em作单位
|
||||
- 各种错误提示优化,更好的兼容php各种环境;
|
||||
- 首次登陆目录不可写提示,登陆页面多语言选择
|
||||
- 登陆页面密码找回提示;管理员密码快速找回;
|
||||
- 登陆页面密码找回提示;管理员密码快速找回;
|
||||
- 验证码复杂性增强
|
||||
- 没有GD库则【关闭验证码;图片直接输出-不生成缩略图】
|
||||
- 登陆:ajax方式(成功&失败)[失败原因码——验证码:换图片;输入框焦点设置]
|
||||
|
|
|
@ -119,7 +119,7 @@ class app extends Controller{
|
|||
|
||||
public function getUrlTitle(){
|
||||
$html = curl_get_contents($this->in['url']);
|
||||
$result = matching($html,"<title>(.*)<\/title>");
|
||||
$result = match_text($html,"<title>(.*)<\/title>");
|
||||
if (strlen($result)>50) {
|
||||
$result = mb_substr($result,0,50,'utf-8');
|
||||
}
|
||||
|
|
|
@ -89,7 +89,11 @@ class explorer extends Controller{
|
|||
unset($data['downloadPath']);
|
||||
}
|
||||
if($data['size'] < 100*1024|| isset($this->in['getMd5'])){//100kb
|
||||
if($data['size'] <= 1024*1024*100){
|
||||
$data['fileMd5'] = @md5_file($file);
|
||||
}else{
|
||||
$data['fileMd5'] = "---";
|
||||
}
|
||||
}else{
|
||||
$data['fileMd5'] = "...";
|
||||
}
|
||||
|
@ -184,8 +188,8 @@ class explorer extends Controller{
|
|||
}
|
||||
}
|
||||
Hook::trigger("explorer.mkdirBefore",$path);
|
||||
if(mk_dir($path,DEFAULT_DIR_PERRMISSIONS)){
|
||||
chmod_path($path,DEFAULT_DIR_PERRMISSIONS);
|
||||
if(mk_dir($path,DEFAULT_PERRMISSIONS)){
|
||||
chmod_path($path,DEFAULT_PERRMISSIONS);
|
||||
Hook::trigger("explorer.mkdirAfter",$path);
|
||||
return true;
|
||||
}
|
||||
|
@ -948,7 +952,7 @@ class explorer extends Controller{
|
|||
}
|
||||
}
|
||||
}
|
||||
$zipFile = $this->zip($userTemp,rand_string(9).'-',fasle);//下载文件夹删除;不检测和记录空间变更
|
||||
$zipFile = $this->zip($userTemp,rand_string(9).'-',false);//下载文件夹删除;不检测和记录空间变更
|
||||
show_json(LNG('zip_success'),true,get_path_this($zipFile));
|
||||
}
|
||||
public function zip($zipPath='',$namePre = "",$checkSpaceChange = true){
|
||||
|
@ -998,7 +1002,7 @@ class explorer extends Controller{
|
|||
$info = LNG('zip_success').LNG('size').":".size_format(filesize($zipname));
|
||||
show_json($info,true,_DIR_OUT(iconv_app($zipname)) );
|
||||
}else{
|
||||
show_json(LNG.error,false);
|
||||
show_json(LNG('error'),false);
|
||||
}
|
||||
}else{
|
||||
return iconv_app($zipname);
|
||||
|
@ -1272,13 +1276,6 @@ class explorer extends Controller{
|
|||
$GLOBALS['kodPathAuthCheck'] = true;//组权限发生变更。导致访问groupPath 无权限退出问题
|
||||
foreach($favList as $key => $val){
|
||||
$thePath = _DIR($val['path']);
|
||||
$hasChildren = path_haschildren($thePath,$checkFile);
|
||||
if( !isset($val['type'])){
|
||||
$val['type'] = 'folder';
|
||||
}
|
||||
if( $val['type'] == 'folder' && $val['ext'] != 'tree-fav'){
|
||||
$hasChildren = true;
|
||||
}
|
||||
$cell = array(
|
||||
'name' => $val['name'],
|
||||
'ext' => $val['ext'],
|
||||
|
|
|
@ -89,7 +89,7 @@ class setting extends Controller{
|
|||
}
|
||||
show_json(LNG('success'),true);
|
||||
}
|
||||
private function clearSession(){
|
||||
private function _clearSession(){
|
||||
del_dir(KOD_SESSION);
|
||||
}
|
||||
private function _clearCache(){
|
||||
|
|
|
@ -15,7 +15,7 @@ class share extends Controller{
|
|||
parent::__construct();
|
||||
$auth = systemRole::getInfo(1);//经过role检测
|
||||
|
||||
$arrNotCheck = array('commonJs');
|
||||
$arrNotCheck = array('commonJs','manifest','manifestJS');
|
||||
if(substr($this->in['fileUrl'],0,4) == 'http'){
|
||||
$arrNotCheck[] = 'fileGet';
|
||||
}
|
||||
|
@ -278,7 +278,24 @@ class share extends Controller{
|
|||
}
|
||||
echo 'LNG='.$lang.';G.useTime='.$useTime.';';
|
||||
}
|
||||
|
||||
//chrome安装: 必须https;serviceWorker引入处理;manifest配置; [manifest.json配置目录同sw.js引入];
|
||||
public function manifest(){
|
||||
$json = file_get_contents(BASIC_PATH.'static/others/app/manifest.json');
|
||||
$name = stristr(I18n::getType(),'zh') ? '可道云':'kodExplorer';
|
||||
$static = STATIC_PATH == './static/' ? APP_HOST.'static/':STATIC_PATH;
|
||||
$assign = array(
|
||||
"{{name}}" => $name,
|
||||
"{{appDesc}}" => LNG('common.copyright.name'),
|
||||
"{{static}}" => $static,
|
||||
);
|
||||
$json = str_replace(array_keys($assign),array_values($assign),$json);
|
||||
header("Content-Type: application/javascript; charset=utf-8");
|
||||
echo $json;
|
||||
}
|
||||
public function manifestJS(){
|
||||
header("Content-Type: application/javascript; charset=utf-8");
|
||||
echo file_get_contents(BASIC_PATH.'static/others/app/sw.js');
|
||||
}
|
||||
|
||||
|
||||
//========ajax function============
|
||||
|
|
|
@ -28,7 +28,7 @@ class user extends Controller{
|
|||
$this->notCheckST = array('share','debug');
|
||||
$this->notCheckACT = array(
|
||||
'loginFirst','login','logout','loginSubmit',
|
||||
'checkCode','publicLink','qrcode','sso');
|
||||
'checkCode','publicLink','qrcode','sso','appConfig');
|
||||
|
||||
$this->notCheckApp = array();//'pluginApp.to'
|
||||
if(!$this->user){
|
||||
|
@ -42,6 +42,7 @@ class user extends Controller{
|
|||
|
||||
public function bindHook(){
|
||||
$this->loadModel('Plugin')->init();
|
||||
$this->bindCheckPassword();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -155,6 +156,42 @@ class user extends Controller{
|
|||
}
|
||||
}
|
||||
|
||||
private function _loginCheckPassword($user,$password){
|
||||
if($this->checkPassword($password)) return;
|
||||
if($user['role'] == '1'){ // 管理员,提示修改;
|
||||
if(isset($_SESSION['adminPasswordTips'])) return;
|
||||
@session_start();
|
||||
$_SESSION['adminPasswordTips']= 1;
|
||||
@session_write_close();
|
||||
show_tips("安全提示:<br/><br/>密码长度必须大于6,同时包含英文和数字;<br/>强烈建议登陆后修改密码!",false);
|
||||
}
|
||||
show_tips("密码长度必须大于6,同时包含英文和数字;<br/>请联系管理员修改后再试!",false);
|
||||
}
|
||||
private function checkPassword($password){
|
||||
if(INSTALL_CHANNEL =='hikvision.com'){
|
||||
$this->config['settingSystemDefault']['passwordCheck'] = '1';
|
||||
}
|
||||
if($this->config['settingSystemDefault']['passwordCheck'] == '0') return true;
|
||||
|
||||
$hasNumber = preg_match('/\d/',$password);
|
||||
$hasChar = preg_match('/[A-Za-z]/',$password);
|
||||
if( strlen($password) >= 6 && $hasNumber && $hasChar) return true;
|
||||
return false;
|
||||
}
|
||||
private function bindCheckPassword(){
|
||||
$action = strtolower(ST.'.'.ACT);
|
||||
$check = array(
|
||||
'user.changepassword' => 'passwordNew',
|
||||
'systemmember.edit' => 'password',
|
||||
'systemmember.add' => 'password',
|
||||
);
|
||||
if(!isset($check[$action])) return;
|
||||
|
||||
$password = $this->in[$check[$action]];
|
||||
if($this->checkPassword($password)) return;
|
||||
show_json("密码长度必须大于6,同时包含英文和数字;<br/>请联系管理员修改后再试!",false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 共享kod登陆并跳转
|
||||
* check: 校验方式:userID|userName|roleID|roleName|groupID|groupName,为空则所有登陆用户
|
||||
|
@ -443,6 +480,7 @@ class user extends Controller{
|
|||
}
|
||||
|
||||
//首次登陆,初始化app 没有最后登录时间
|
||||
$this->_loginCheckPassword($user,$password);
|
||||
$this->_loginSuccess($user);//登陆成功
|
||||
if(!$user['lastLogin']){
|
||||
$app = init_controller('app');
|
||||
|
@ -606,7 +644,7 @@ class user extends Controller{
|
|||
ob_get_clean();
|
||||
QRcode::png($this->in['url']);
|
||||
}else{
|
||||
header('location: http://qr.topscan.com/api.php?text='.rawurlencode($url));
|
||||
header('location: https://demo.kodcloud.com/?user/view/qrcode&url='.rawurlencode($url));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -349,24 +349,6 @@ function array_try($array, $callback){
|
|||
}
|
||||
return false;
|
||||
}
|
||||
// 求多个数组的并集
|
||||
function array_union(){
|
||||
$argsCount = func_num_args();
|
||||
if ($argsCount < 2) {
|
||||
return false;
|
||||
} else if (2 === $argsCount) {
|
||||
list($arr1, $arr2) = func_get_args();
|
||||
|
||||
while ((list($k, $v) = each($arr2))) {
|
||||
if (!in_array($v, $arr1)) $arr1[] = $v;
|
||||
}
|
||||
return $arr1;
|
||||
} else { // 三个以上的数组合并
|
||||
$arg_list = func_get_args();
|
||||
$all = call_user_func_array('array_union', $arg_list);
|
||||
return array_union($arg_list[0], $all);
|
||||
}
|
||||
}
|
||||
// 取出数组中第n项
|
||||
function array_get_index($arr,$index){
|
||||
foreach($arr as $k=>$v){
|
||||
|
@ -446,7 +428,7 @@ function fatalErrorHandler(){
|
|||
}
|
||||
|
||||
function show_tips($message,$url= '', $time = 3,$title = '',$exit = true){
|
||||
ob_get_clean();
|
||||
ob_get_clean();$time=500;
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
$goto = "content='$time;url=$url'";
|
||||
$info = "{$time}s 后自动跳转, <a href='$url'>立即跳转</a>";
|
||||
|
@ -669,9 +651,9 @@ function show_json($data,$code = true,$info=''){
|
|||
|
||||
function show_trace(){
|
||||
echo '<pre>';
|
||||
var_dump(func_get_args());
|
||||
var_dump(json_encode(func_get_args()));
|
||||
echo '<hr/>';
|
||||
echo get_caller_info();
|
||||
print_r(get_caller_info());
|
||||
echo '</pre>';
|
||||
exit;
|
||||
}
|
||||
|
@ -759,7 +741,7 @@ function html2txt($document){
|
|||
}
|
||||
|
||||
// 获取内容第一条
|
||||
function matching($content, $preg){
|
||||
function match_text($content, $preg){
|
||||
$preg = "/" . $preg . "/isU";
|
||||
preg_match($preg, $content, $result);
|
||||
return $result[1];
|
||||
|
@ -837,7 +819,7 @@ function get_utf8_str($string, $length, $dot = '...'){
|
|||
* @param string $suffix 截断显示字符
|
||||
* @return string
|
||||
*/
|
||||
function msubstr($str, $start = 0, $length = 0, $charset = "utf-8", $suffix = true){
|
||||
function msubstr($str, $start = 0, $length, $charset = "utf-8", $suffix = true){
|
||||
if (function_exists("mb_substr")) {
|
||||
$i_str_len = mb_strlen($str);
|
||||
$s_sub_str = mb_substr($str, $start, $length, $charset);
|
||||
|
@ -912,24 +894,11 @@ function dump(){call_user_func('pr',func_get_args());}
|
|||
function debug_out(){call_user_func('pr',func_get_args());}
|
||||
|
||||
/**
|
||||
* 取$from~$to范围内的随机数
|
||||
*
|
||||
* @param $from 下限
|
||||
* @param $to 上限
|
||||
* @return unknown_type
|
||||
* 取$from~$to范围内的随机数,包含$from,$to;
|
||||
*/
|
||||
function rand_from_to($from, $to){
|
||||
$size = $to - $from; //数值区间
|
||||
$max = 30000; //最大
|
||||
if ($size < $max) {
|
||||
return $from + mt_rand(0, $size);
|
||||
} else {
|
||||
if ($size % $max) {
|
||||
return $from + random_from_to(0, $size / $max) * $max + mt_rand(0, $size % $max);
|
||||
} else {
|
||||
return $from + random_from_to(0, $size / $max) * $max + mt_rand(0, $max);
|
||||
}
|
||||
}
|
||||
return mt_rand($from,$to);
|
||||
// return $from + mt_rand(0, $to - $from);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -80,12 +80,12 @@ function path_filter($path){
|
|||
//filesize 解决大于2G 大小问题
|
||||
//http://stackoverflow.com/questions/5501451/php-x86-how-to-get-filesize-of-2-gb-file-without-external-program
|
||||
function get_filesize($path){
|
||||
$result = false;
|
||||
$fp = fopen($path,"r");
|
||||
if(! $fp = fopen($path,"r")) return $result;
|
||||
if(PHP_INT_SIZE >= 8 ){ //64bit
|
||||
$result = (float)(abs(sprintf("%u",@filesize($path))));
|
||||
}else{
|
||||
return (float)(abs(sprintf("%u",@filesize($path))));
|
||||
}
|
||||
|
||||
$fp = fopen($path,"r");
|
||||
if(!$fp) return $result;
|
||||
if (fseek($fp, 0, SEEK_END) === 0) {
|
||||
$result = 0.0;
|
||||
$step = 0x7FFFFFFF;
|
||||
|
@ -126,7 +126,6 @@ function get_filesize($path){
|
|||
$result = filesize($path);
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose($fp);
|
||||
return $result;
|
||||
}
|
||||
|
@ -424,10 +423,12 @@ function path_haschildren($dir,$checkFile=false){
|
|||
$fullpath = $dir.$file;
|
||||
if ($checkFile) {//有子目录或者文件都说明有子内容
|
||||
if(@is_file($fullpath) || is_dir($fullpath.'/')){
|
||||
closedir($dh);
|
||||
return true;
|
||||
}
|
||||
}else{//只检查有没有文件
|
||||
if(@is_dir($fullpath.'/')){//解决部分主机报错问题
|
||||
closedir($dh);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -599,7 +600,7 @@ function move_path($source,$dest,$repeat_add='',$repeat_type='replace'){
|
|||
$file_success += move_file($f,$path,$repeat_add,$repeat_type);
|
||||
}
|
||||
foreach($dirs as $f){
|
||||
rmdir($f);
|
||||
@rmdir($f);
|
||||
}
|
||||
@rmdir($source);
|
||||
if($file_success == count($files)){
|
||||
|
@ -1038,25 +1039,26 @@ function file_put_out($file,$download=-1,$downFilename=false){
|
|||
header("X-Powered-By: kodExplorer.");
|
||||
header("X-FileSize: ".$file_size);
|
||||
|
||||
//调用webserver下载
|
||||
$server = strtolower($_SERVER['SERVER_SOFTWARE']);
|
||||
if($server && $GLOBALS['config']['settings']['httpSendFile']){
|
||||
if(strstr($server,'nginx')){//nginx
|
||||
header('X-Accel-Redirect: '.$file);
|
||||
}else if(strstr($server,'apache')){ //apache
|
||||
header("X-Sendfile: ".$file);
|
||||
}else if(strstr($server,'http')){//light http
|
||||
header( "X-LIGHTTPD-send-file: " . $file);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
//远程路径不支持断点续传;打开zip内部文件
|
||||
if(!file_exists($file)){
|
||||
header('HTTP/1.1 200 OK');
|
||||
header('Content-Length: '.($end+1));
|
||||
return;
|
||||
}
|
||||
|
||||
//调用webserver下载
|
||||
$server = strtolower($_SERVER['SERVER_SOFTWARE']);
|
||||
if($server && $GLOBALS['config']['settings']['httpSendFile']){
|
||||
if(strstr($server,'nginx')){//nginx
|
||||
header("X-Accel-Redirect: ".$file);
|
||||
}else if(strstr($server,'apache')){ //apache
|
||||
header('X-Sendfile: '.$file);
|
||||
}else if(strstr($server,'http')){//light http
|
||||
header( "X-LIGHTTPD-send-file: " . $file);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
header("Accept-Ranges: bytes");
|
||||
if (isset($_SERVER['HTTP_RANGE'])){
|
||||
if (preg_match('/bytes=\h*(\d+)-(\d*)[\D.*]?/i', $_SERVER['HTTP_RANGE'], $matches)){
|
||||
|
@ -1211,8 +1213,10 @@ function kod_move_uploaded_file($fromPath,$savePath){
|
|||
show_json('move uploaded file error!',false);
|
||||
}
|
||||
}
|
||||
|
||||
if(!$result = rename($tempPath,$savePath)){
|
||||
del_file($savePath);
|
||||
$result = rename($tempPath,$savePath);
|
||||
}
|
||||
chmod_path($savePath,DEFAULT_PERRMISSIONS);
|
||||
return $result;
|
||||
}
|
||||
|
|
|
@ -59,16 +59,19 @@ function zip_pre_name($fileName,$toCharset=false){
|
|||
return $result;
|
||||
}
|
||||
|
||||
//解压缩文件名检测
|
||||
function unzip_filter_ext($name){
|
||||
$add = '.txt';
|
||||
if(checkExt($name)){//允许
|
||||
if( checkExt($name) &&
|
||||
!stristr($name,'user.ini') &&
|
||||
!stristr($name,'.htaccess')
|
||||
){//允许
|
||||
return $name;
|
||||
}
|
||||
return $name.$add;
|
||||
}
|
||||
//解压到kod,文件名处理;识别编码并转换到当前系统编码
|
||||
function unzip_pre_name($fileName){
|
||||
$fileName = str_replace(array('../','..\\',''),'',$fileName);
|
||||
if (!function_exists('iconv')){
|
||||
return unzip_filter_ext($fileName);
|
||||
}
|
||||
|
@ -226,7 +229,7 @@ function file_upload_size(){
|
|||
}
|
||||
|
||||
function check_list_dir(){
|
||||
$url = APP_HOST.'lib/core/';
|
||||
$url = APP_HOST.'app/core/';
|
||||
$find = "Application.class.php";
|
||||
|
||||
@ini_set('default_socket_timeout',1);
|
||||
|
@ -275,7 +278,7 @@ function php_env_check(){
|
|||
function check_cache(){
|
||||
//检查是否更新失效
|
||||
$content = file_get_contents(BASIC_PATH.'config/version.php');
|
||||
$result = matching($content,"'KOD_VERSION','(.*)'");
|
||||
$result = match_text($content,"'KOD_VERSION','(.*)'");
|
||||
if($result != KOD_VERSION){
|
||||
show_tips("您服务器开启了php缓存,文件更新尚未生效;
|
||||
请关闭缓存,或稍后1分钟刷新页面再试!
|
||||
|
|
|
@ -153,7 +153,7 @@ class Services_JSON
|
|||
return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
|
||||
}
|
||||
|
||||
$bytes = (ord($utf16{0}) << 8) | ord($utf16{1});
|
||||
$bytes = (ord($utf16[0]) << 8) | ord($utf16[1]);
|
||||
|
||||
switch(true) {
|
||||
case ((0x7F & $bytes) == $bytes):
|
||||
|
@ -206,17 +206,17 @@ class Services_JSON
|
|||
case 2:
|
||||
// return a UTF-16 character from a 2-byte UTF-8 char
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
return chr(0x07 & (ord($utf8{0}) >> 2))
|
||||
. chr((0xC0 & (ord($utf8{0}) << 6))
|
||||
| (0x3F & ord($utf8{1})));
|
||||
return chr(0x07 & (ord($utf8[0]) >> 2))
|
||||
. chr((0xC0 & (ord($utf8[0]) << 6))
|
||||
| (0x3F & ord($utf8[1])));
|
||||
|
||||
case 3:
|
||||
// return a UTF-16 character from a 3-byte UTF-8 char
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
return chr((0xF0 & (ord($utf8{0}) << 4))
|
||||
| (0x0F & (ord($utf8{1}) >> 2)))
|
||||
. chr((0xC0 & (ord($utf8{1}) << 6))
|
||||
| (0x7F & ord($utf8{2})));
|
||||
return chr((0xF0 & (ord($utf8[0]) << 4))
|
||||
| (0x0F & (ord($utf8[1]) >> 2)))
|
||||
. chr((0xC0 & (ord($utf8[1]) << 6))
|
||||
| (0x7F & ord($utf8[2])));
|
||||
}
|
||||
|
||||
// ignoring UTF-32 for now, sorry
|
||||
|
@ -609,7 +609,7 @@ class Services_JSON
|
|||
} elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) {
|
||||
// array, or object notation
|
||||
|
||||
if ($str{0} == '[') {
|
||||
if ($str[0]== '[') {
|
||||
$stk = array(SERVICES_JSON_IN_ARR);
|
||||
$arr = array();
|
||||
} else {
|
||||
|
|
|
@ -598,7 +598,7 @@ function url_header($url){
|
|||
if (strstr($name,'=')) $name = substr($name,strrpos($name,'=')+1);
|
||||
if (!$name) $name = 'file.data';
|
||||
}
|
||||
if(isset($header['x-outfilename'])){
|
||||
if(!empty($header['x-outfilename'])){
|
||||
$name = $header['x-outfilename'];
|
||||
}
|
||||
$name = rawurldecode(trim($name,'"'));
|
||||
|
@ -663,7 +663,8 @@ function parse_url_query($url){
|
|||
$params = array();
|
||||
foreach ($queryParts as $param) {
|
||||
$item = explode('=', $param);
|
||||
$params[$item[0]] = $item[1];
|
||||
$key = $item[0]; unset($item[0]);
|
||||
$params[$key] = implode('=', $item);
|
||||
}
|
||||
return $params;
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ class PluginBase{
|
|||
if(!is_array($systemConfig['pluginList'])){
|
||||
$systemConfig['pluginList'] = array();
|
||||
}
|
||||
if(is_array($systemConfig['pluginList'][$name])){
|
||||
if(is_array($systemConfig['pluginList'][$id])){
|
||||
$systemConfig['pluginList'][$id]['regiest'] = $array;
|
||||
}else{
|
||||
$systemConfig['pluginList'][$id] = array(
|
||||
|
|
|
@ -30,12 +30,12 @@ class MyCaptcha{
|
|||
for($i=0;$i<$fontfile_width && $symbol<$alphabet_length;$i++){
|
||||
$transparent = (imagecolorat($font, $i, 0) >> 24) == 127;
|
||||
if(!$reading_symbol && !$transparent){
|
||||
$font_metrics[$alphabet[$symbol]]=array('start'=>$i);
|
||||
$font_metrics[$alphabet{$symbol}]=array('start'=>$i);
|
||||
$reading_symbol=true;
|
||||
continue;
|
||||
}
|
||||
if($reading_symbol && $transparent){
|
||||
$font_metrics[$alphabet[$symbol]]['end']=$i;
|
||||
$font_metrics[$alphabet{$symbol}]['end']=$i;
|
||||
$reading_symbol=false;
|
||||
$symbol++;
|
||||
continue;
|
||||
|
@ -51,7 +51,7 @@ class MyCaptcha{
|
|||
$odd=mt_rand(0,1);
|
||||
if($odd==0) $odd=-1;
|
||||
for($i=0;$i<$length;$i++){
|
||||
$m=$font_metrics[$this->keystring[$i]];
|
||||
$m=$font_metrics[$this->keystring{$i}];
|
||||
|
||||
$y=(($i%2)*$fluctuation_amplitude - $fluctuation_amplitude/2)*$odd
|
||||
+ mt_rand(-round($fluctuation_amplitude/3), round($fluctuation_amplitude/3))
|
||||
|
@ -149,7 +149,7 @@ class MyCaptcha{
|
|||
while(true){
|
||||
$str = '';
|
||||
for($i=0;$i<$length;$i++){
|
||||
$str .= $allowed_symbols[mt_rand(0,strlen($allowed_symbols)-1)];
|
||||
$str .= $allowed_symbols{mt_rand(0,strlen($allowed_symbols)-1)};
|
||||
}
|
||||
if(!preg_match('/cp|cb|ck|c6|c9|rn|rm|mm|co|do|cl|db|qp|qb|dp|ww/',$str)) break;
|
||||
}
|
||||
|
|
|
@ -2535,7 +2535,7 @@ class lessc_parser {
|
|||
// whitespace after the operator for it to be an expression
|
||||
$needWhite = $whiteBefore && !$this->inParens;
|
||||
|
||||
if ($this->matching(self::$operatorString.($needWhite ? '\s' : ''), $m) && self::$precedence[$m[1]] >= $minP) {
|
||||
if ($this->match(self::$operatorString.($needWhite ? '\s' : ''), $m) && self::$precedence[$m[1]] >= $minP) {
|
||||
if (!$this->inParens && isset($this->env->currentProperty) && $m[1] == "/" && empty($this->env->supressedDivision)) {
|
||||
foreach (self::$supressDivisionProps as $pattern) {
|
||||
if (preg_match($pattern, $this->env->currentProperty)) {
|
||||
|
@ -2662,7 +2662,7 @@ class lessc_parser {
|
|||
}
|
||||
|
||||
// css hack: \0
|
||||
if ($this->literal('\\') && $this->matching('([0-9]+)', $m)) {
|
||||
if ($this->literal('\\') && $this->match('([0-9]+)', $m)) {
|
||||
$value = array('keyword', '\\'.$m[1]);
|
||||
return true;
|
||||
} else {
|
||||
|
@ -2766,7 +2766,7 @@ class lessc_parser {
|
|||
$nestingLevel = 0;
|
||||
|
||||
$content = array();
|
||||
while ($this->matching($patt, $m, false)) {
|
||||
while ($this->match($patt, $m, false)) {
|
||||
if (!empty($m[1])) {
|
||||
$content[] = $m[1];
|
||||
if ($nestingOpen) {
|
||||
|
@ -2835,7 +2835,7 @@ class lessc_parser {
|
|||
$oldWhite = $this->eatWhiteDefault;
|
||||
$this->eatWhiteDefault = false;
|
||||
|
||||
while ($this->matching($patt, $m, false)) {
|
||||
while ($this->match($patt, $m, false)) {
|
||||
$content[] = $m[1];
|
||||
if ($m[2] == "@{") {
|
||||
$this->count -= strlen($m[2]);
|
||||
|
@ -2894,7 +2894,7 @@ class lessc_parser {
|
|||
if (!ctype_digit($char) && $char != ".") return false;
|
||||
}
|
||||
|
||||
if ($this->matching('([0-9]+(?:\.[0-9]*)?|\.[0-9]+)([%a-zA-Z]+)?', $m)) {
|
||||
if ($this->match('([0-9]+(?:\.[0-9]*)?|\.[0-9]+)([%a-zA-Z]+)?', $m)) {
|
||||
$unit = array("number", $m[1], empty($m[2]) ? "" : $m[2]);
|
||||
return true;
|
||||
}
|
||||
|
@ -2903,7 +2903,7 @@ class lessc_parser {
|
|||
|
||||
// a # color
|
||||
protected function color(&$out) {
|
||||
if ($this->matching('(#(?:[0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{3}))', $m)) {
|
||||
if ($this->match('(#(?:[0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{3}))', $m)) {
|
||||
if (strlen($m[1]) > 7) {
|
||||
$out = array("string", "", array($m[1]));
|
||||
} else {
|
||||
|
@ -3066,7 +3066,7 @@ class lessc_parser {
|
|||
break; // get out early
|
||||
}
|
||||
|
||||
if ($this->matching('\s+', $m)) {
|
||||
if ($this->match('\s+', $m)) {
|
||||
$attrParts[] = " ";
|
||||
continue;
|
||||
}
|
||||
|
@ -3093,7 +3093,7 @@ class lessc_parser {
|
|||
}
|
||||
|
||||
// operator, handles attr namespace too
|
||||
if ($this->matching('[|-~\$\*\^=]+', $m)) {
|
||||
if ($this->match('[|-~\$\*\^=]+', $m)) {
|
||||
$attrParts[] = $m[0];
|
||||
continue;
|
||||
}
|
||||
|
@ -3133,7 +3133,7 @@ class lessc_parser {
|
|||
$this->eatWhiteDefault = false;
|
||||
|
||||
while (true) {
|
||||
if ($this->matching('(['.$chars.'0-9]['.$chars.']*)', $m)) {
|
||||
if ($this->match('(['.$chars.'0-9]['.$chars.']*)', $m)) {
|
||||
$parts[] = $m[1];
|
||||
if ($simple) break;
|
||||
|
||||
|
@ -3184,7 +3184,7 @@ class lessc_parser {
|
|||
protected function func(&$func) {
|
||||
$s = $this->seek();
|
||||
|
||||
if ($this->matching('(%|[\w\-_][\w\-_:\.]+|[\w_])', $m) && $this->literal('(')) {
|
||||
if ($this->match('(%|[\w\-_][\w\-_:\.]+|[\w_])', $m) && $this->literal('(')) {
|
||||
$fname = $m[1];
|
||||
|
||||
$sPreArgs = $this->seek();
|
||||
|
@ -3253,7 +3253,7 @@ class lessc_parser {
|
|||
|
||||
// consume a keyword
|
||||
protected function keyword(&$word) {
|
||||
if ($this->matching('([\w_\-\*!"][\w\-_"]*)', $m)) {
|
||||
if ($this->match('([\w_\-\*!"][\w\-_"]*)', $m)) {
|
||||
$word = $m[1];
|
||||
return true;
|
||||
}
|
||||
|
@ -3350,7 +3350,7 @@ class lessc_parser {
|
|||
self::$literalCache[$what] = lessc::preg_quote($what);
|
||||
}
|
||||
|
||||
return $this->matching(self::$literalCache[$what], $m, $eatWhitespace);
|
||||
return $this->match(self::$literalCache[$what], $m, $eatWhitespace);
|
||||
}
|
||||
|
||||
protected function genericList(&$out, $parseItem, $delim="", $flatten=true) {
|
||||
|
@ -3387,14 +3387,14 @@ class lessc_parser {
|
|||
} else {
|
||||
$validChars = $allowNewline ? "." : "[^\n]";
|
||||
}
|
||||
if (!$this->matching('('.$validChars.'*?)'.lessc::preg_quote($what), $m, !$until)) return false;
|
||||
if (!$this->match('('.$validChars.'*?)'.lessc::preg_quote($what), $m, !$until)) return false;
|
||||
if ($until) $this->count -= strlen($what); // give back $what
|
||||
$out = $m[1];
|
||||
return true;
|
||||
}
|
||||
|
||||
// try to match something on head of buffer
|
||||
protected function matching($regex, &$out, $eatWhitespace = null) {
|
||||
protected function match($regex, &$out, $eatWhitespace = null) {
|
||||
if ($eatWhitespace === null) $eatWhitespace = $this->eatWhiteDefault;
|
||||
|
||||
$r = '/'.$regex.($eatWhitespace && !$this->writeComments ? '\s*' : '').'/Ais';
|
||||
|
@ -3420,7 +3420,7 @@ class lessc_parser {
|
|||
}
|
||||
return $gotWhite;
|
||||
} else {
|
||||
$this->matching("", $m);
|
||||
$this->match("", $m);
|
||||
return strlen($m[0]) > 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,5 +43,6 @@
|
|||
[ /^(.*\.(?:css|js))(.*)$/i,'$1$2?ver='+G.version]
|
||||
]
|
||||
});
|
||||
if(navigator.serviceWorker){navigator.serviceWorker.register('./?share/manifestJS');}
|
||||
</script>
|
||||
<?php Hook::trigger('templateCommonFooter');?>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<link href="<?php echo STATIC_PATH;?>images/common/ico.png?ver=<?php echo KOD_VERSION;?>" rel="icon" type="image/x-icon">
|
||||
<link href="<?php echo STATIC_PATH;?>style/common.css?ver=<?php echo KOD_VERSION;?>" rel="stylesheet"/>
|
||||
<link href="./static/style/font-awesome/css/font-awesome.css?ver=<?php echo KOD_VERSION;?>" rel="stylesheet">
|
||||
<link rel="manifest" href="./static/manifest.json">
|
||||
<link href="./?share/manifest" rel="manifest" />
|
||||
<!--[if IE 7]>
|
||||
<link rel="stylesheet" href="./static/style/font-awesome/css/font-awesome-ie7.css">
|
||||
<![endif]-->
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
}
|
||||
$login_info = str_replace(array("{0}","{1}","{2}"),array('admin','demo/demo','guest/guest'),LNG('install_user_default'));
|
||||
echo LNG('install_login'),'<br/>'.$login_info.'</div>';
|
||||
echo '<div class="inputs admin-password"><input type="password" placeholder="'.LNG('login_root_password').'" autocomplete="off"/></div><div class="inputs admin-password-repeat"><input type="password" placeholder="'.LNG('login_root_password_repeat').'" autocomplete="off"/></div>';
|
||||
echo '<div class="inputs admin-password"><input type="password" placeholder="'.LNG('login_root_password').'"/></div><div class="inputs admin-password-repeat"><input type="password" placeholder="'.LNG('login_root_password_repeat').'"/></div>';
|
||||
echo '<div class="guest"><a href="javascript:void(0);" class="start">'.$login.'</a></div>';
|
||||
?>
|
||||
</div>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<div class='info'><?php echo LNG('copyright_contact');?></div>
|
||||
</div>
|
||||
<div class="form" style="padding: 10px 20px;">
|
||||
<div class="inputs admin-password"><input type="text" placeholder="LICENSE KEY" autocomplete="off"/></div>
|
||||
<div class="inputs admin-password"><input type="text" placeholder="LICENSE KEY"/></div>
|
||||
<a href="javascript:void(0);" class="LICENSE_SUBMIT btn btn-primary">注册授权</a>
|
||||
<div class="links">
|
||||
<a href="./index.php?user/versionInstall&reset=1" class="btn btn-link license-use-free"><?php echo LNG('use_free');?></a>
|
||||
|
|
|
@ -43,11 +43,12 @@
|
|||
<i class="font-icon icon-key"></i>
|
||||
<input id="password" name='password' type="password" placeholder="<?php echo LNG('password');?>"
|
||||
required autocomplete="on" disabled/>
|
||||
<input type='hidden' name='csrfLogin' value="<?php echo $_SESSION['csrfLogin'];?>"/>
|
||||
</div>
|
||||
<?php if(need_check_code()){?>
|
||||
<div class='check-code'>
|
||||
<i class="font-icon icon-unlock-alt"></i>
|
||||
<input name='checkCode' class="check-code" type="text" placeholder="<?php echo LNG('login_code');?>" required autocomplete="off"/>
|
||||
<input name='checkCode' class="check-code" type="text" placeholder="<?php echo LNG('login_code');?>" required/>
|
||||
<img src='./index.php?user/checkCode' onclick="this.src='./index.php?user/checkCode'" />
|
||||
</div>
|
||||
<?php }?>
|
||||
|
|
|
@ -26,12 +26,13 @@
|
|||
<i class="font-icon icon-key"></i>
|
||||
<input id="password" name='password' type="password" placeholder="<?php echo LNG('password');?>"
|
||||
required disabled/>
|
||||
<input type='hidden' name='csrfLogin' value="<?php echo $_SESSION['csrfLogin'];?>"/>
|
||||
</div>
|
||||
|
||||
<?php if(need_check_code()){?>
|
||||
<div class='check-code'>
|
||||
<i class="font-icon icon-unlock-alt"></i>
|
||||
<input name='checkCode' class="check-code" type="text" placeholder="<?php echo LNG('login_code');?>" required autocomplete="off"/>
|
||||
<input name='checkCode' class="check-code" type="text" placeholder="<?php echo LNG('login_code');?>" required/>
|
||||
<img src='./index.php?user/checkCode' onclick="this.src='./index.php?user/checkCode'" />
|
||||
</div>
|
||||
<?php }?>
|
||||
|
|
|
@ -63,9 +63,7 @@ function updateCheck(){
|
|||
|
||||
function unzipRepeat(){
|
||||
$zipFile = THE_DATA_PATH.'2.0-'.UPDATE_VERSION.'.zip';
|
||||
if(!file_exists($zip_file)){
|
||||
return;
|
||||
}
|
||||
if(!file_exists($zipFile)) return;
|
||||
$zip = new PclZip($zipFile);
|
||||
$result = $zip->extract(PCLZIP_OPT_PATH,THE_BASIC_PATH,PCLZIP_OPT_REPLACE_NEWER);
|
||||
}
|
||||
|
@ -93,7 +91,7 @@ function updateClear(){
|
|||
function check_version_ok(){
|
||||
//检查是否更新失效
|
||||
$content = file_get_contents(BASIC_PATH.'config/version.php');
|
||||
$result = match($content,"'KOD_VERSION','(.*)'");
|
||||
$result = match_text($content,"'KOD_VERSION','(.*)'");
|
||||
if($result != KOD_VERSION){
|
||||
show_tips("您服务器开启了php缓存,文件更新尚未生效;
|
||||
请关闭缓存,或稍后1分钟刷新页面再试!
|
||||
|
|
|
@ -18,12 +18,12 @@ if(GLOBAL_DEBUG){
|
|||
define('STATIC_JS','_dev'); //_dev||app
|
||||
define('STATIC_LESS','less');//less||css
|
||||
@ini_set("display_errors","on");
|
||||
@error_reporting(E_ALL^E_NOTICE);//
|
||||
@error_reporting(E_ALL^E_NOTICE^E_WARNING^E_DEPRECATED);//
|
||||
}else{
|
||||
define('STATIC_JS','app'); //app
|
||||
define('STATIC_LESS','css');//css
|
||||
@ini_set("display_errors","on");//on off
|
||||
@error_reporting(E_ALL^E_NOTICE^E_WARNING);// 0
|
||||
@error_reporting(E_ALL^E_NOTICE^E_WARNING^E_DEPRECATED);// 0
|
||||
}
|
||||
|
||||
//header('HTTP/1.1 200 Ok');//兼容部分lightHttp服务器环境; php5.1以下会输出异常;暂屏蔽
|
||||
|
@ -38,14 +38,13 @@ define('FUNCTION_DIR', LIB_DIR .'function/'); //函数库目录
|
|||
define('CLASS_DIR', LIB_DIR .'kod/'); //工具类目录
|
||||
define('CORER_DIR', LIB_DIR .'core/'); //核心目录
|
||||
define('SDK_DIR', LIB_DIR .'sdks/'); //
|
||||
define('DEFAULT_PERRMISSIONS',0640); //新建文件、解压文件默认权限
|
||||
define('DEFAULT_DIR_PERRMISSIONS',0750);//新建目录
|
||||
define('DEFAULT_PERRMISSIONS',0755); //新建文件、解压文件默认权限,777 部分虚拟主机限制了777;
|
||||
|
||||
/*
|
||||
* 可以数据目录;移到web目录之外,可以使程序更安全, 就不用限制用户的扩展名权限了;
|
||||
* 1. 需要先将data文件夹移到别的地方 例如将data文件夹拷贝到D:/
|
||||
* 2. 在config文件夹下新建define.php 新增一行 <?php define('DATA_PATH','D:/data/');
|
||||
* 注意:路径不能写错;其次php需要有权限访问移动后的目录(设置了防跨站需要关闭)
|
||||
* 注意:路径不能写错;其次php需要有权限访问移动后的目录(设置了防跨站需要关闭) 路径结尾/斜杠绝对不能缺少
|
||||
*/
|
||||
if(file_exists(BASIC_PATH.'config/define.php')){
|
||||
include(BASIC_PATH.'config/define.php');
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
<?php define ('DATA_PATH', '/opt/kodexplorer-data/');
|
|
@ -111,7 +111,7 @@ return array(
|
|||
"system_role_read" => "Read-only",
|
||||
"system_role_write" => "Kann lesen und schreiben",
|
||||
"system_setting_root_path" => "root-Zugriff",
|
||||
"system_setting_root_path_desc" => "Nur ein Systemadministrator sollte auf alle Verzeichnisse zugreifen sollen, andere Rechte Benutzergruppen können nur ihre eigenen Benutzerverzeichnisse sehen. Wenn Sie ein- oder ausschalten zu anderen Verzeichnissen Zugriff<br/>Administrator möchten, können Sie die PHP open_basedir anti-Cross-Site-Parameter ändern,<a href=\"https://www.google.com.hk/search?&q=php+open_basedir\" target=\"_ |