修复 手机版细节BUG;

修复 修正部分PHP7.1兼容;
优化 部分HTTPS兼容;
修复 安装程序剩余空间判断问题;
This commit is contained in:
康盛Discuz! 2016-12-19 11:27:06 +08:00
parent d39cb2f98f
commit 5af76fd126
9 changed files with 39 additions and 26 deletions

View File

@ -4,7 +4,7 @@
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: install_function.php 36287 2016-12-12 03:59:05Z nemohou $
* $Id: install_function.php 36311 2016-12-19 01:47:34Z nemohou $
*/
if(!defined('IN_COMSENZ')) {
@ -140,14 +140,9 @@ function env_check(&$env_items) {
} elseif($key == 'diskspace') {
if(function_exists('disk_free_space')) {
$space = disk_free_space(ROOT_PATH);
if($space > 1048576) {
if($space > 1073741824) {
$space = floor($space / 1073741824).'GB';
} else {
$space = floor($space / 1048576).'MB';
}
}
$env_items[$key]['current'] = $space;
$env_items[$key]['status'] = $space > $item['r'] ? 1 : 0;
$env_items[$key]['r'] = format_space($item['r']);
$env_items[$key]['current'] = format_space($space);
} else {
$env_items[$key]['current'] = 'unknow';
}
@ -1734,3 +1729,13 @@ function install_extra_setting() {
$db->query("REPLACE INTO {$tablepre}common_setting SET skey='$key', svalue='".addslashes(serialize($val))."'");
}
}
function format_space($space) {
if($space > 1048576) {
if($space > 1073741824) {
return floor($space / 1073741824).'GB';
} else {
return floor($space / 1048576).'MB';
}
}
return $space;
}

View File

@ -4,7 +4,7 @@
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: install_var.php 36287 2016-12-12 03:59:05Z nemohou $
* $Id: install_var.php 36311 2016-12-19 01:47:34Z nemohou $
*/
if(!defined('IN_COMSENZ')) {
@ -75,7 +75,7 @@ $env_items = array
'gdversion' => array('r' => '1.0', 'b' => '2.0'),
'curl' => array('r' => 'notset', 'b' => 'enable'),
'opcache' => array('r' => 'notset', 'b' => 'enable'),
'diskspace' => array('r' => '30MB', 'b' => 'notset'),
'diskspace' => array('r' => 30 * 1024 * 1024, 'b' => 'notset'),
);
$dirfile_items = array

View File

@ -4,7 +4,7 @@
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: admincp_cloudaddons.php 35706 2015-12-01 06:15:03Z nemohou $
* $Id: admincp_cloudaddons.php 36311 2016-12-19 01:47:34Z nemohou $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
@ -30,7 +30,11 @@ if(!$operation) {
$extra .= '&'.addslashes($_GET['extra']);
}
$url = cloudaddons_url($extra);
echo '<script type="text/javascript">location.href=\''.$url.'\';</script>';
if($_G['isHTTPS']) {
echo '<script type="text/javascript">window.open(\''.$url.'\');</script>';
} else {
echo '<script type="text/javascript">location.href=\''.$url.'\';</script>';
}
} elseif($operation == 'download') {
$step = intval($_GET['step']);

View File

@ -86,7 +86,7 @@ ac14d324de325ee9485caca992f796c1 *source/admincp/admincp_card.php
615d2c26ecb9e7818cbce80d286a5adb *source/admincp/admincp_checktools.php
b40bc52669c410d5fbedaaf37550fb01 *source/admincp/admincp_click.php
85ef3aadb8fad22f669b99e44da52649 *source/admincp/admincp_cloud.php
b3d0837eef87b5ebfd0b7a1e177eed64 *source/admincp/admincp_cloudaddons.php
2aeb7e0c601d5986bb9986c515e04e53 *source/admincp/admincp_cloudaddons.php
a7564ff1d1d99de04603d6a6f588a6e5 *source/admincp/admincp_collection.php
93c0cd010c921640c9bc5c06aa6c9394 *source/admincp/admincp_comment.php
6558bce5672e89e7e974deb172fa4912 *source/admincp/admincp_counter.php
@ -324,7 +324,7 @@ ba8f93e2baa105875cbca0152cdd8645 *source/class/class_sphinx.php
1a50bfab1b9481e9302157185480936c *source/class/class_tag.php
c06d0078f78d3c10743914daa92a2822 *source/class/class_task.php
f84a8ef882403ab585f1fcda9993ae8b *source/class/class_template.php
02586f739f8c898944389c53515a7f9b *source/class/class_xml.php
a38d1ee63a97ac42ed1f42ffe61cbf0b *source/class/class_xml.php
0243c69f103b8167e4e75aae836b3886 *source/class/class_zip.php
6ae7355eb5c58e09663781b4aa285ff9 *source/class/db/db_driver_mysql.php
85f6aea709d5982cef153e32fb504ac0 *source/class/db/db_driver_mysqli.php
@ -332,7 +332,7 @@ fb05c4f082d4098a9e567b2d56cb8344 *source/class/db/db_driver_mysqli_slave.php
e28eb546c80966c63d5cca19063b7d53 *source/class/db/db_driver_mysql_slave.php
d41d8cd98f00b204e9800998ecf8427e *source/class/db/index.htm
1ceced2869a2fa890163e144db1397a0 *source/class/discuz/discuz_admincp.php
a7662f8720f48cf37455056e69caf7cd *source/class/discuz/discuz_application.php
5127987cb99cd702f99922465148c68d *source/class/discuz/discuz_application.php
5bb1ba4480bcfd862809bf5f5951d5cf *source/class/discuz/discuz_base.php
b0b7df7926c2cdd89957cca31ba54c41 *source/class/discuz/discuz_block.php
65b49f9945e59899ad73b61f343e585a *source/class/discuz/discuz_censor.php
@ -382,7 +382,7 @@ f44c81f0cf86f12e234da0e7f03d11f0 *source/class/helper/helper_json.php
cd6ed5c1af415245d93e3235c8ede908 *source/class/helper/helper_log.php
5385476aea9b3fb11a4e82607755229e *source/class/helper/helper_makehtml.php
10279125c8f8700d2538bef2b2115d73 *source/class/helper/helper_manyou.php
04e433744de5aa6a07b80cb6da97d42d *source/class/helper/helper_mobile.php
f57ebeb0cb3a17f2880db75d8c0701a1 *source/class/helper/helper_mobile.php
7475503d83d1bf22546c71ae2ec630d5 *source/class/helper/helper_notification.php
239adbca6a95f305233fd10859f4eb72 *source/class/helper/helper_output.php
7f6bfc8f913438196c7abe21865c6805 *source/class/helper/helper_page.php

View File

@ -4,7 +4,7 @@
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: class_xml.php 27449 2012-02-01 05:32:35Z zhangguosheng $
* $Id: class_xml.php 36311 2016-12-19 01:47:34Z nemohou $
*/
if(!defined('IN_DISCUZ')) {
@ -63,7 +63,7 @@ class XMLparse {
function parse(&$data) {
$this->document = array();
$this->stack = array();
return xml_parse($this->parser, $data, true) && !$this->failed ? $this->document : '';
return xml_parse($this->parser, $data, true) && !$this->failed ? $this->document : array();
}
function open(&$parser, $tag, $attributes) {

View File

@ -4,7 +4,7 @@
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: discuz_application.php 36284 2016-12-12 00:47:50Z nemohou $
* $Id: discuz_application.php 36311 2016-12-19 01:47:34Z nemohou $
*/
if(!defined('IN_DISCUZ')) {
@ -185,7 +185,8 @@ class discuz_application extends discuz_base{
$sitepath = preg_replace("/\/archiver/i", '', $sitepath);
}
$_G['isHTTPS'] = ($_SERVER['HTTPS'] && strtolower($_SERVER['HTTPS']) != 'off') ? true : false;
$_G['siteurl'] = dhtmlspecialchars('http'.($_G['isHTTPS'] ? 's' : '').'://'.$_SERVER['HTTP_HOST'].$sitepath.'/');
$_G['scheme'] = 'http'.($_G['isHTTPS'] ? 's' : '');
$_G['siteurl'] = dhtmlspecialchars($_G['scheme'].'://'.$_SERVER['HTTP_HOST'].$sitepath.'/');
$url = parse_url($_G['siteurl']);
$_G['siteroot'] = isset($url['path']) ? $url['path'] : '';

View File

@ -4,7 +4,7 @@
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: helper_mobile.php 36278 2016-12-09 07:52:35Z nemohou $
* $Id: helper_mobile.php 36311 2016-12-19 01:47:34Z nemohou $
*/
if(!defined('IN_DISCUZ')) {
@ -41,7 +41,7 @@ class helper_mobile {
parse_str($_SERVER['QUERY_STRING'], $query);
$query['mobile'] = 'no';
$query_sting_tmp = http_build_query($query);
$_G['setting']['mobile']['pageurl'] = $_G['siteurl'].substr($_G['PHP_SELF'], 1).$query_sting_tmp;
$_G['setting']['mobile']['pageurl'] = $_G['siteurl'].substr($_G['PHP_SELF'], 1).'?'.$query_sting_tmp;
unset($query_sting_tmp);
dsetcookie('dismobilemessage', '1', 3600);
showmessage('not_in_mobile');

View File

@ -4,7 +4,7 @@
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: DiscuzTips.php 33303 2013-05-23 03:35:36Z andyzheng $
* $Id: DiscuzTips.php 36311 2016-12-19 01:47:34Z nemohou $
*/
if(!defined('IN_DISCUZ')) {
@ -30,6 +30,9 @@ class Cloud_Service_DiscuzTips {
if($_G['inajax']) {
return '';
}
if($_G['isHTTPS']) {
return '';
}
$clientVersion = '2';
$util = Cloud::loadclass('Service_Util');
include_once DISCUZ_ROOT . '/source/discuz_version.php';

View File

@ -14,11 +14,11 @@ if(!defined('IN_DISCUZ')) {
class plugin_pcmgr_url_safeguard{
function _include_js(){
global $_G;
$jsscript = '<script src="http://pc1.gtimg.com/js/jquery-1.4.4.min.js" type="text/javascript"></script>';
$jsscript = '<script src="'.$_G['scheme'].'://pc1.gtimg.com/js/jquery-1.4.4.min.js" type="text/javascript"></script>';
$jsscript .= '<script type="text/javascript">jQuery.noConflict();</script>';
$jsscript .= "<script type=\"text/javascript\">(function(d){j=d.createElement('script');j.src='//openapi.guanjia.qq.com/fcgi-bin/getdzjs?cmd=urlquery_" . $_G['config']['output']['charset'] . "_" . $_G['config']['output']['language'] . "';j.setAttribute('ime-cfg','lt=2');d.getElementsByTagName('head')[0].appendChild(j)})(document)</script>";
$jsscript .= '<link rel="stylesheet" type="text/css" href="http://s.pc.qq.com/discuz/css/style.css" />';
$jsscript .= '<link rel="stylesheet" type="text/css" href="'.$_G['scheme'].'://s.pc.qq.com/discuz/css/style.css" />';
return $jsscript;
}
}