Skip to content

Commit

Permalink
Discuz! X3.4 Thai UTF-8 R20211124, Rev.71
Browse files Browse the repository at this point in the history
- ปรับปรุง ฟังก์ชัน Cloud Addons ไม่ให้มีการรายงานไปยังระบบดิสคัสจีน ได้แก่ การติดตั้งปลั๊กอิน, การถอนการติดตั้ง, การรายงานข้อผิดพลาดและรายงานอื่น ๆ ที่เกี่ยวข้องกับปลั๊กอิน/สกิน ทั้งหมด
- ปรับปรุง ให้แสดงหมายเลข Rev. ของดิสคัสภาษาไทยในหน้าติดตั้ง
- ปรับปรุง การแปลภาษาไทยในส่วนของ AdminCP (Special thanks to: @jason @สุทธสีโล และ @ทูน่า)
- ปรับปรุง อัปเดตความปลอดภัยสะสม
- แก้ไขปัญหา ไม่สามารถพิมพ์เลข ๑ (เลขไทย) ในหน้าตั้งกระทู้/ตอบกระทู้ (Special thanks to: @สุทธสีโล และ @popiazaza via GitHub Repository)
- แก้ไขปัญหา การเรียกใช้ UID ในหน้าโปรโฟล์ของโหมด touch ไม่ถูกต้อง
- แก้ไขปัญหา การเรียกใช้ ID ไฟล์แนบซ้ำกันในหน้าตั้งกระทู้
- แก้ไขปัญหา กรณีที่ผู้ใช้ไม่สามารถเข้าสู่ระบบได้บางประการ
  • Loading branch information
jaideejung007 committed Dec 30, 2021
1 parent 763f015 commit 46bbc11
Show file tree
Hide file tree
Showing 20 changed files with 402 additions and 397 deletions.
13 changes: 5 additions & 8 deletions upload/api/db/dbbak.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,16 +218,13 @@ function connect($dbhost, $dbuser, $dbpw, $dbname = '', $dbcharset, $pconnect =
$this->halt('Can not connect to MySQL server');
}

if($this->version() > '4.1') {
if($dbcharset) {
$this->link->set_charset($dbcharset);
}

if($this->version() > '5.0.1') {
$this->query("SET sql_mode=''");
}
if($dbcharset) {
$this->link->set_charset($dbcharset);
}

$this->link->query("SET sql_mode=''");

$this->link->query("SET character_set_client=binary");

}

Expand Down
2 changes: 2 additions & 0 deletions upload/config/config_global_default.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

$_config = array();

// 提示:自当前版本起,本文件不支持调用系统内任何变量或函数,请依赖此行为的站点修正实现 //

// ---------------------------- CONFIG DB ----------------------------- //
// ---------------------------- 数据库相关设置---------------------------- //

Expand Down
3 changes: 2 additions & 1 deletion upload/install/include/install_function.php
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ function show_header() {
global $step;
$version = DISCUZ_VERSION;
$release = DISCUZ_RELEASE;
$th_revision = DISCUZ_TH_REVISION; /*jaideejung007*/
$install_lang = lang(INSTALL_LANG);
$title = lang('title_install');
$charset = CHARSET;
Expand All @@ -646,7 +647,7 @@ function showmessage(message) {
<div class="container">
<div class="header">
<h1>$title</h1>
<span>Discuz!$version $install_lang $release</span>
<span>Discuz!$version $install_lang $release Rev.$th_revision</span>
EOT;

$step > 0 && show_step($step);
Expand Down
15 changes: 7 additions & 8 deletions upload/install/include/install_mysqli.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@ function connect($dbhost, $dbuser, $dbpw, $dbname = '', $dbcharset, $pconnect =
$this->halt('Can not connect to MySQL server');
}

if($this->version() > '4.1') {
if($dbcharset) {
$this->link->set_charset($dbcharset);
}

if($this->version() > '5.0.1') {
$this->query("SET sql_mode=''");
}
if($dbcharset) {
$this->link->set_charset($dbcharset);
}

$this->link->query("SET sql_mode=''");

$this->link->query("SET character_set_client=binary");

}

function fetch_array($query, $result_type = MYSQLI_ASSOC) {
Expand Down
6 changes: 6 additions & 0 deletions upload/source/admincp/admincp_setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -2551,6 +2551,10 @@ function setrowtypedata(sendtype) {
cpmsg('uc_config_appid_error', '', 'error');
}

if(!empty($settingnew['uc']['ip']) && !filter_var($settingnew['uc']['ip'], FILTER_VALIDATE_IP)) {
cpmsg('uc_config_ip_error', '', 'error');
}

if(function_exists("mysql_connect") && ini_get("mysql.allow_local_infile")=="1" && constant("UC_DBHOST") != $settingnew['uc']['dbhost']){
cpmsg('uc_config_load_data_local_infile_error', '', 'error');
}
Expand All @@ -2568,6 +2572,8 @@ function setrowtypedata(sendtype) {
}
}

$settingnew['uc']['api'] = str_replace(array('\'', '"', '\\', "\0", "\n", "\r"), '', $settingnew['uc']['api']);

$fp = fopen('./config/config_ucenter.php', 'r');
$configfile = fread($fp, filesize('./config/config_ucenter.php'));
$configfile = trim($configfile);
Expand Down
308 changes: 154 additions & 154 deletions upload/source/admincp/discuzfiles.md5

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion upload/source/class/class_member.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function on_login() {
if($_G['group']['forcelogin'] == 1) {
clearcookies();
showmessage('location_login_force_qq');
} elseif($_G['group']['forcelogin'] == 2 && $_GET['loginfield'] != 'email') {
} elseif($_G['group']['forcelogin'] == 2 && $_GET['loginfield'] != 'email' && $_GET['username'] !== $result['ucresult']['email']) {
clearcookies();
showmessage('location_login_force_mail');
}
Expand Down
28 changes: 16 additions & 12 deletions upload/source/class/discuz/discuz_application.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ static function &instance() {
}

public function __construct() {
$this->_init_cnf();
$this->_init_env();
$this->_init_config();
$this->_init_input();
Expand Down Expand Up @@ -135,7 +136,7 @@ private function _init_env() {

'pluginrunlist' => !defined('PLUGINRUNLIST') ? array() : explode(',', PLUGINRUNLIST),

'config' => array(),
'config' => & $this->config,
'setting' => array(),
'member' => array(),
'group' => array(),
Expand Down Expand Up @@ -275,7 +276,7 @@ private function _init_input() {

}

private function _init_config() {
private function _init_cnf() {

$_config = array();
@include DISCUZ_ROOT.'./config/config_global.php';
Expand All @@ -288,30 +289,33 @@ private function _init_config() {
}
}

if(empty($_config['security']['authkey'])) {
$_config['security']['authkey'] = md5($_config['cookie']['cookiepre'].$_config['db'][1]['dbname']);
$this->config = & $_config;

}

private function _init_config() {

if(empty($this->var['config']['security']['authkey'])) {
$this->var['config']['security']['authkey'] = md5($this->var['config']['cookie']['cookiepre'].$this->var['config']['db'][1]['dbname']);
}

if(empty($_config['debug']) || !file_exists(libfile('function/debug'))) {
if(empty($this->var['config']['debug']) || !file_exists(libfile('function/debug'))) {
define('DISCUZ_DEBUG', false);
error_reporting(0);
} elseif($_config['debug'] === 1 || $_config['debug'] === 2 || !empty($_REQUEST['debug']) && $_REQUEST['debug'] === $_config['debug']) {
} elseif($this->var['config']['debug'] === 1 || $this->var['config']['debug'] === 2 || !empty($_REQUEST['debug']) && $_REQUEST['debug'] === $this->var['config']['debug']) {
define('DISCUZ_DEBUG', true);
error_reporting(E_ERROR);
if($_config['debug'] === 2) {
if($this->var['config']['debug'] === 2) {
error_reporting(E_ALL);
}
} else {
define('DISCUZ_DEBUG', false);
error_reporting(0);
}
define('STATICURL', !empty($_config['output']['staticurl']) ? $_config['output']['staticurl'] : 'static/');
define('STATICURL', !empty($this->var['config']['output']['staticurl']) ? $this->var['config']['output']['staticurl'] : 'static/');
$this->var['staticurl'] = STATICURL;

$this->config = & $_config;
$this->var['config'] = & $_config;

if(substr($_config['cookie']['cookiepath'], 0, 1) != '/') {
if(substr($this->var['config']['cookie']['cookiepath'], 0, 1) != '/') {
$this->var['config']['cookie']['cookiepath'] = '/'.$this->var['config']['cookie']['cookiepath'];
}
$this->var['config']['cookie']['cookiepre'] = $this->var['config']['cookie']['cookiepre'].substr(md5($this->var['config']['cookie']['cookiepath'].'|'.$this->var['config']['cookie']['cookiedomain']), 0, 4).'_';
Expand Down
4 changes: 2 additions & 2 deletions upload/source/discuz_version.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

if(!defined('DISCUZ_VERSION')) {
define('DISCUZ_VERSION', 'X3.4');
define('DISCUZ_RELEASE', '20211022');
define('DISCUZ_RELEASE', '20211124');
define('DISCUZ_FIXBUG', '34000000');
define('DISCUZ_TH_REVISION', '70'); /*jaideejung007*/
define('DISCUZ_TH_REVISION', '71'); /*jaideejung007*/
}

?>
6 changes: 3 additions & 3 deletions upload/source/function/function_cloudaddons.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,21 @@ function cloudaddons_pluginlogo_url($id) {
function cloudaddons_installlog($addonid) {
$array = cloudaddons_getmd5($addonid);
if($array['RevisionID']) {
cloudaddons_open('&mod=app&ac=installlog&rid='.$array['RevisionID']);
/*jaideejung007*/ /*cloudaddons_open('&mod=app&ac=installlog&rid='.$array['RevisionID']);*/
}
}

function cloudaddons_downloadlog($addonid) {
$array = cloudaddons_getmd5($addonid);
if($array['RevisionID']) {
cloudaddons_open('&mod=app&ac=downloadlog&rid='.$array['RevisionID']);
/*jaideejung007*/ /*cloudaddons_open('&mod=app&ac=downloadlog&rid='.$array['RevisionID']);*/
}
}

function cloudaddons_faillog($rid, $type) {
$rid = intval($rid);
$type = intval($type);
cloudaddons_open('&mod=app&ac=faillog&rid='.$rid.'&type='.$type.'&serverinfo='.urlencode($_SERVER['SERVER_SOFTWARE']));
/*jaideejung007*/ /*cloudaddons_open('&mod=app&ac=faillog&rid='.$rid.'&type='.$type.'&serverinfo='.urlencode($_SERVER['SERVER_SOFTWARE']));*/
}

function cloudaddons_removelog($rid) {
Expand Down
4 changes: 3 additions & 1 deletion upload/source/include/topicadmin/topicadmin_stickreply.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
showmessage('admin_nopermission', NULL);
}
$sticktopiclist = $posts = array();
$authorids = array();
foreach($topiclist as $pid) {
$post = C::t('forum_post')->fetch('tid:'.$_G['tid'], $pid, false);
$authorids[] = array('authorid' => $post['authorid']);
$sticktopiclist[$pid] = $post['position'];
}

Expand Down Expand Up @@ -70,7 +72,7 @@

$resultarray = array(
'redirect' => "forum.php?mod=viewthread&tid=$_G[tid]&page=$page",
'reasonpm' => ($sendreasonpm ? array('data' => array(array('authorid' => $post['authorid'])), 'var' => 'post', 'notictype' => 'post', 'item' => $_GET['stickreply'] ? 'reason_stickreply': 'reason_stickdeletereply') : array()),
'reasonpm' => ($sendreasonpm ? array('data' => $authorids, 'var' => 'post', 'notictype' => 'post', 'item' => $_GET['stickreply'] ? 'reason_stickreply': 'reason_stickdeletereply') : array()),
'reasonvar' => array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason),
'modlog' => $thread
);
Expand Down
Loading

0 comments on commit 46bbc11

Please sign in to comment.