release 4.39 update

pull/336/head
warlee 2019-03-06 22:45:11 +08:00
parent eeadf4aeab
commit deabe685e7
24 changed files with 125 additions and 118 deletions

File diff suppressed because one or more lines are too long

View File

@ -58,20 +58,22 @@ function get_url_scheme($url){
return $res['scheme'];
}
function http_type(){
if( (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ||
(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') ||
$_SERVER['SERVER_PORT'] === 443
){
return 'https';
}
return 'http';
}
function get_host() {
//兼容子目录反向代理:只能是前端js通过cookie传入到后端进行处理
if(defined('GLOBAL_DEBUG') && isset($_COOKIE['HOST']) && isset($_COOKIE['APP_HOST'])){
return $_COOKIE['HOST'];
}
$protocol = (!empty($_SERVER['HTTPS'])
&& $_SERVER['HTTPS'] !== 'off'
|| $_SERVER['SERVER_PORT'] === 443) ? 'https://' : 'http://';
if( isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &&
strlen($_SERVER['HTTP_X_FORWARDED_PROTO']) > 0 ){
$protocol = $_SERVER['HTTP_X_FORWARDED_PROTO'].'://';
}
$protocol = http_type().'://';
$url_host = $_SERVER['SERVER_NAME'].($_SERVER['SERVER_PORT']=='80' ? '' : ':'.$_SERVER['SERVER_PORT']);
$host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $url_host;
$host = isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $host;//proxy
@ -123,6 +125,24 @@ function is_wap(){
return false;
}
/**
* 终止并完成http请求客户端终止等待完成请求
* 后续代码可以继续运行;例如日志、统计等代码;后续输出将不再生效;
*/
function http_close(){
ignore_timeout(0);
if(function_exists('fastcgi_finish_request')) {
fastcgi_finish_request();
} else {
header("Connection: close");
header("Content-Length: ".ob_get_length());
ob_start();
echo str_pad('',1024*5);
ob_end_flush();
flush();
}
}
function parse_headers($raw_headers){
$headers = array();
$key = '';
@ -535,85 +555,69 @@ function request_url_safe($url){
// url header data
function url_header($url){
$name = '';$length=0;
$header = get_headers_curl($url);//curl优先
if(is_array($header)){
$header['ACTION_BY'] = 'get_headers_curl';
}else{
$header = @get_headers($url,true);
}
if (!$header) return false;
if(isset($header['Content-Length'])){
if(is_array($header['Content-Length'])){
$length = array_pop($header['Content-Length']);
}else{
$length = $header['Content-Length'];
}
}
//301跳转
$fileUrl = $url;
$location = 'Location';
if(!isset($header['Location']) &&
isset($header['location'])){
$location = 'location';
//加入小写header值;兼容各种不统一的情况
$header['———'] = '————————————';//分隔
foreach ($header as $key => $value) {
$header[strtolower($key)] = $value;
}
if(isset($header[$location])){
if(is_string($header[$location])){
$fileUrl = $header[$location];
}else if(is_array($header[$location]) && count($header[$location])>0 ){
$fileUrl = $header[$location][count($header[$location])-1];
}
}
if(isset($header['Content-Disposition'])){
if(is_array($header['Content-Disposition'])){
$dis = array_pop($header['Content-Disposition']);
}else{
$dis = $header['Content-Disposition'];
}
$i = strpos($dis,"filename=");
if($i!== false){
$name = substr($dis,$i+9);
$j = strpos($name,"; ");//多个参数,
if($j!== false){
$name = substr($name,0,$j);
$checkArr = array(
'content-length' => 0,
'location' => $url,//301调整
'content-disposition' => '',
);
//处理多次跳转的情况
foreach ($checkArr as $key=>$val) {
if(isset($header[$key])){
$checkArr[$key] = $header[$key];
if(is_array($header[$key]) && count($header[$key])>0){
$checkArr[$key] = $header[$key][count($header[$key])-1];
}
$name = trim($name,'"');
}
}
if(isset($header['X-OutFileName'])){
$name = $header['X-OutFileName'];
}
$name = $checkArr['content-disposition'];
$length = $checkArr['content-length'];
$fileUrl= $checkArr['location'];
if($name){
preg_match('/filename\s*=\s*"*(.*)"*?/',$name,$match);
if(count($match) == 2){
$name = $match[1];
}else{
$name = '';
}
}
if(!$name){
$name = get_path_this($fileUrl);
if (stripos($name,'?')) $name = substr($name,0,stripos($name,'?'));
if (!$name) $name = 'index.html';
$firstName = get_path_this($url);
if( get_path_ext($firstName) == get_path_ext($name) ){
$name = $firstName;
}
if (strstr($name,'=')) $name = substr($name,strrpos($name,'=')+1);
if (!$name) $name = 'file.data';
}
$name = rawurldecode($name);
if(isset($header['x-outfilename'])){
$name = $header['x-outfilename'];
}
$name = rawurldecode(trim($name,'"'));
$name = str_replace(array('/','\\'),'-',$name);//safe;
$supportRange = isset($header["Accept-Ranges"])?true:false;
$supportRange = isset($header["accept-ranges"])?true:false;
if(!request_url_safe($fileUrl)){
$fileUrl = "";
}
$result = array(
'url' => $fileUrl,
'length' => $length,
'name' => trim($name,'"'),
'supportRange' =>$supportRange && ($length!=0),
'name' => $name,
'supportRange' => $supportRange && ($length!=0),
'all' => $header,
);
if(!function_exists('curl_init')){
$result['supportRange'] = false;
}
//debug_out($url,$header,$result);
//pr($url,$result);
return $result;
}

View File

@ -25,7 +25,9 @@ function updateCheck(){
if(!file_exists(THE_DATA_PATH.'system/install.lock')){
if(UPDATE_DEV){
echo 'not install!';exit;
}else{
}
//从2.x 升级
if( !file_exists(THE_DATA_PATH.'system/member.php') ){
return;
}
}
@ -35,6 +37,7 @@ function updateCheck(){
if( file_exists(THE_DATA_PATH.'system/member.php') &&
!file_exists(THE_DATA_PATH.'system/system_member.php')){
new updateToV330();
new Update3To400();
}
//from [3.30~3.36] //还原用户目录

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -662,22 +662,23 @@ var pathTools = (function(){
* var aDate = (new Date(a)).getTime(),bDate = aDate ? (new Date(b)).getTime() : null;
* if (bDate){return aDate==bDate?0:(aDate>bDate?1:-1);}
*/
var isNumeric = function(string){
return !isNaN(parseFloat(string)) && isFinite(string)
}
var substrNumber = function(str,from){
res = '';
for (var i = from; i < str.length; i++) {
var char = str.charAt(i);
if(isNumeric(char) || char == '.'){
res += char+'';
}else{
break;
}
}
return parseFloat(res);
}
var strSort = function(a,b){
var isNumeric = function(str){
return !isNaN(parseFloat(str)) && isFinite(str);
}
var substrNumber = function(str,from){
res = '';
for (var i = from; i < str.length; i++) {
var char = str.charAt(i);
if(isNumeric(char) || char == '.'){
res += char+'';
}else{
break;
}
}
return parseFloat(res);
}
if(isNumeric(a) && isNumeric(b)){
a = parseFloat(a);
b = parseFloat(b);
@ -707,7 +708,6 @@ var pathTools = (function(){
if(aIndex==bIndex) continue;
return (aIndex>bIndex?1:-1);
}else{
//英文字符排在中文字符前
if( aChar.charCodeAt() < 255 || bChar.charCodeAt() < 255){
if(aChar == bChar) continue;
return aChar>bChar?1:-1;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/* power by kodexplorer ver 4.39(2019-03-06) [build 1551873230.6625] */
/* power by kodexplorer ver 4.39(2019-03-06) [build 1551883307.668] */
@import url('./fileIcon.css');
@import url('./common.css');
.frame-main{position:absolute;top:40px;width:100%;bottom:0px;}.frame-main .tools-left{background:#f8f8f8 url("../../../images/common/bg.gif") 0 0px;position:fixed;line-height:30px;padding-left:20px;height:28px;border-bottom:1px solid #ddd;left:0;width:100%;}.frame-main .tools-left a{font-size:1.25em;font-weight:800;text-decoration:none;color:#999;text-shadow:0 0 3px;display:inline-block;padding:2px 6px;margin-top:0;height:20px;line-height:20px;}.frame-main .tools-left a:hover{background:url("../../../images/common/buttons_40.png") 0 0px repeat-x;-webkit-box-shadow:0 2px 8px rgba(0,0,0,0.8);-moz-box-shadow:0 2px 8px rgba(0,0,0,0.8);box-shadow:0 2px 8px rgba(0,0,0,0.8);-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}.frame-main .frame-left{position:absolute;left:0;top:30px;bottom:0;width:200px;background:#fff;background-attachment:fixed;overflow:auto;}.frame-main .frame-left .ztree{margin-top:0;}.frame-main .frame-left .ztree li.level0{margin-bottom:5px;}.frame-main .frame-resize{width:10px;cursor:col-resize;z-index:100;position:absolute;left:195px;top:0;bottom:0;overflow:hidden;background:url("../../../images/common/resize.png") 0px 50% no-repeat;}.frame-main .frame-resize.active{background:#000;opacity:0.2;filter:alpha(opacity=20);}.frame-main .frame-right{left:200px;right:0;position:absolute;top:0;bottom:0;overflow:auto;}.frame-main .frame-right .frame-right-main .resize-mask{z-index:999;position:absolute;left:0;top:0;bottom:0;right:0;display:none;}.frame-main .frame-right .frame-right-main .frame{height:100%;border-left:1px solid #ddd;overflow:hidden;}
/* ver 4.39(2019-03-06) [build 1551873230.6625] */
/* ver 4.39(2019-03-06) [build 1551883307.668] */

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long