Skip to content

Commit 5c96fcb

Browse files
committed
Merge Official Patch 20151208
1 parent d42cfc6 commit 5c96fcb

File tree

459 files changed

+13795
-39651
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

459 files changed

+13795
-39651
lines changed

source/admincp/admincp_checktools.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* [Discuz!] (C)2001-2099 Comsenz Inc.
55
* This is NOT a freeware, use is subject to license terms
66
*
7-
* $Id: admincp_checktools.php 31554 2012-09-07 08:49:56Z monkey $
7+
* $Id: admincp_checktools.php 35472 2015-08-03 09:06:22Z nemohou $
88
*/
99

1010
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
@@ -362,6 +362,14 @@
362362

363363
$settingnew = $_GET['settingnew'];
364364
if(!empty($_GET['previewthumb'])) {
365+
if(!is_dir($settingnew['imageimpath'])) {
366+
$settingnew['imageimpath'] = '';
367+
} else {
368+
$settingnew['imageimpath'] = str_replace('\\', '/', $settingnew['imageimpath']);
369+
if(!preg_match('/^[\!@#\$%\^&\(\)_\+\-\=\{\}\[\];\',\.\/\:\w\s]+$/', $settingnew['imageimpath'])) {
370+
$settingnew['imageimpath'] = '';
371+
}
372+
}
365373
$_G['setting']['imagelib'] = $settingnew['imagelib'];
366374
$_G['setting']['imageimpath'] = $settingnew['imageimpath'];
367375
$_G['setting']['thumbwidth'] = $settingnew['thumbwidth'];

source/admincp/admincp_cloudaddons.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* [Discuz!] (C)2001-2099 Comsenz Inc.
55
* This is NOT a freeware, use is subject to license terms
66
*
7-
* $Id: admincp_cloudaddons.php 33369 2013-06-03 05:00:29Z andyzheng $
7+
* $Id: admincp_cloudaddons.php 35705 2015-12-01 06:14:33Z nemohou $
88
*/
99
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
1010
exit('Access Denied');
@@ -35,8 +35,7 @@
3535
} elseif($operation == 'download') {
3636
$step = intval($_GET['step']);
3737
$addoni = intval($_GET['i']);
38-
$uniqueid = $_G['setting']['siteuniqueid'] ? $_G['setting']['siteuniqueid'] : C::t('common_setting')->fetch('siteuniqueid');
39-
if(!$_GET['md5hash'] || md5($_GET['addonids'].md5($uniqueid.$_GET['timestamp'])) != $_GET['md5hash']) {
38+
if(!$_GET['md5hash'] || md5($_GET['addonids'].md5(cloudaddons_getuniqueid().$_GET['timestamp'])) != $_GET['md5hash']) {
4039
cpmsg('cloudaddons_validator_error', '', 'error');
4140
}
4241
$addonids = explode(',', $_GET['addonids']);

source/admincp/discuzfiles.md5

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ d41d8cd98f00b204e9800998ecf8427e *data/template/index.htm
7070
d41d8cd98f00b204e9800998ecf8427e *data/threadcache/index.htm
7171
0d673a9b9f136a7a6b6b25d4ff4bc1fd *./install
7272
08066574cc9c9cfa186b8e1a7ba35b5c *./source
73-
4eeab4f3170c81bab4c3df07e0d276d0 *source/discuz_version.php
73+
d774fb851c4ad4f88ea19469fd7353cf *source/discuz_version.php
7474
7215ee9c7d9dc229d2921a40e899ec5f *source/index.htm
7575
0a7896849dd83bbf64a31ccf11e58a17 *source/admincp/admincp_admingroup.php
7676
8896d084661345e3de22cb445536f2cb *source/admincp/admincp_adv.php
@@ -86,10 +86,10 @@ e48263dce4356396f52bfbcfb5071c64 *source/admincp/admincp_block.php
8686
dda34ea9edc3f37fb7f3c8bae9d587e0 *source/admincp/admincp_blogcategory.php
8787
20479a5ebcc8c8de3dac7a61764af979 *source/admincp/admincp_blogrecyclebin.php
8888
ac14d324de325ee9485caca992f796c1 *source/admincp/admincp_card.php
89-
5e0ea6696805c296eaa6fdd9f5ee8bf2 *source/admincp/admincp_checktools.php
89+
2ac5ca0a276104f1b12b2bab03ad27e2 *source/admincp/admincp_checktools.php
9090
b40bc52669c410d5fbedaaf37550fb01 *source/admincp/admincp_click.php
9191
85ef3aadb8fad22f669b99e44da52649 *source/admincp/admincp_cloud.php
92-
eafad7bb76a8672f771147a2f2b4d278 *source/admincp/admincp_cloudaddons.php
92+
50bbccf077a293c4f9ef5f9515a27d4a *source/admincp/admincp_cloudaddons.php
9393
a7564ff1d1d99de04603d6a6f588a6e5 *source/admincp/admincp_collection.php
9494
93c0cd010c921640c9bc5c06aa6c9394 *source/admincp/admincp_comment.php
9595
6558bce5672e89e7e974deb172fa4912 *source/admincp/admincp_counter.php
@@ -381,7 +381,7 @@ d41d8cd98f00b204e9800998ecf8427e *source/class/forum/index.htm
381381
79feb45e4626dbba96e19ea147fff3e2 *source/class/helper/helper_antitheft.php
382382
59220a31da954b7d2227f336dbb6f0c3 *source/class/helper/helper_attach.php
383383
7022fd0d4c037305b08aa3702a6add1e *source/class/helper/helper_dbtool.php
384-
0d82e5d1b0ab576c3e0168074fc484d7 *source/class/helper/helper_form.php
384+
b4a48768f230e623de4e45fe99241f55 *source/class/helper/helper_form.php
385385
f44c81f0cf86f12e234da0e7f03d11f0 *source/class/helper/helper_json.php
386386
cd6ed5c1af415245d93e3235c8ede908 *source/class/helper/helper_log.php
387387
5385476aea9b3fb11a4e82607755229e *source/class/helper/helper_makehtml.php
@@ -727,20 +727,20 @@ f9fabd8329b3a8a91c7a8996bd0bc4cc *source/class/task/task_profile.php
727727
d92c261612a6b18fa0f32c5832420258 *source/function/function_block.php
728728
fda0f9733c9d07e18ac8b6aa1f04a4ba *source/function/function_blog.php
729729
10152e216afcc2730c7961778fd2d36a *source/function/function_cache.php
730-
f5ff825bf0d19f9e00ae7dcf1f3acfea *source/function/function_cloudaddons.php
730+
f917245b79f202d4cc72f5542af42ff8 *source/function/function_cloudaddons.php
731731
77f06f33b827d1155c5c3c2f28bc7909 *source/function/function_collection.php
732732
90ee4789682564336c6043e19dc2dcb8 *source/function/function_comment.php
733-
d5a65d86d0bf5f3108fd585b54d19493 *source/function/function_core.php
733+
c404fdd625f0e359950b11e18d885a0f *source/function/function_core.php
734734
fca8f813316f070ad4026e06b938db1d *source/function/function_credit.php
735735
dc26872be5adc5364f42bc0335c4b504 *source/function/function_delete.php
736-
30bda91dc181cecb1d39315f57bd7c2a *source/function/function_discuzcode.php
736+
25f4f2b24b9a727183618d3e60a157e1 *source/function/function_discuzcode.php
737737
9270deaa36c685a3f408bb9cee2db317 *source/function/function_domain.php
738738
aaca86dc933b77a2313a4d463cf356a6 *source/function/function_ec_credit.php
739739
59dbdc54dc7367bb120babaceaace2c1 *source/function/function_editor.php
740740
ed60f1ffa5730c849ff679cf8fd5efcb *source/function/function_exif.php
741741
f04336160dae343fe6604156811d68ed *source/function/function_feed.php
742742
c47efcdd8ba9dcb0d7320c28eea4e086 *source/function/function_filesock.php
743-
dfd83566bf1ab8634155e0bf57ca51cd *source/function/function_followcode.php
743+
1cc0c56581f027b3d91a51d422a8d3ec *source/function/function_followcode.php
744744
1c962bafb265c3e1dbafd63a9e0da270 *source/function/function_forum.php
745745
53af5593f8b73b90b1a627c434310b8a *source/function/function_forumlist.php
746746
10758d44f84170af87ed5d0a4f15d657 *source/function/function_friend.php
@@ -1170,7 +1170,7 @@ cb51cfe16559084716000b0725fb111a *source/module/forum/forum_rss.php
11701170
9eacb72a42d21156d35b2a8956cc0fdc *source/module/forum/forum_tag.php
11711171
571fc4f66dc650cdf4548ff0d8d60e40 *source/module/forum/forum_topicadmin.php
11721172
e7d4e8fed8d979a928cd8960eec25f2d *source/module/forum/forum_trade.php
1173-
f05cca10355dfc9a24c981dc6f69e462 *source/module/forum/forum_viewthread.php
1173+
06d43c18f22efc68a2a3de683e7fe1ab *source/module/forum/forum_viewthread.php
11741174
d41d8cd98f00b204e9800998ecf8427e *source/module/forum/index.htm
11751175
6ac2bc80c87d24ef37a87e02cf9f31cd *source/module/group/group_attentiongroup.php
11761176
b15c4aa15189bfdc446e1459929c773f *source/module/group/group_index.php
@@ -1216,7 +1216,7 @@ b06844b70785922e2cb5100b9f958685 *source/module/misc/misc_ranklist.php
12161216
1b7b4fdeb70502cbb855b32ae3e24d55 *source/module/misc/misc_seccode.php
12171217
4206a5bc3be20b2294752c38bcb6b0a1 *source/module/misc/misc_secqaa.php
12181218
8c5c539ef08c4ebad727020a04352103 *source/module/misc/misc_stat.php
1219-
8919f1089311965d2a9eaa449c713674 *source/module/misc/misc_swfupload.php
1219+
f9894157f4f320c958bbb16a07101106 *source/module/misc/misc_swfupload.php
12201220
8cff67e3f9f57d6eec68f1fada15202f *source/module/misc/misc_tag.php
12211221
b2e980162b4365aa940f4a2675e0cf68 *source/module/misc/misc_userstatus.php
12221222
d41d8cd98f00b204e9800998ecf8427e *source/module/portal/index.htm
@@ -2481,7 +2481,7 @@ b7d9174d54261a48fb7854d55fcb7852 *static/js/admincp.js
24812481
f619c8cbedf000f59d83d7ac61633767 *static/js/ajax.js
24822482
f4c8df3bcee17f02b333a7375777fefa *static/js/at.js
24832483
2d39b948d499baafb9102d32066b2cd8 *static/js/autoloadpage.js
2484-
64de46a394e0ab04021efd942b244100 *static/js/bbcode.js
2484+
87efdff43e4f794b4c1fb26394a6f0d7 *static/js/bbcode.js
24852485
85b59b1b90ddaf58bdab571698539495 *static/js/calendar.js
24862486
ec73c26f3b4b3e606c9acf9904af6626 *static/js/common.js
24872487
ebd21b3e2d0ecd4346546d0cd629bf80 *static/js/common_diy.js
@@ -2963,7 +2963,7 @@ af55380c7b9fe10b851c44886e9d2d50 *template/default/home/spacecp_upload.htm
29632963
9fb1f3dd6bae1647e1013e032a53267a *template/default/home/spacecp_usergroup.htm
29642964
2acc665da23d785108539569d20a4954 *template/default/home/spacecp_usergroup_header.htm
29652965
3c467ef9914518be03d6cb944ec67d52 *template/default/home/spacecp_videophoto.htm
2966-
082ea59206f18e26752474e4f7f89b3e *template/default/member/getpasswd.htm
2966+
9720e182ebdde207c689d1734392fdd2 *template/default/member/getpasswd.htm
29672967
565e669f1d0f24519158a3f9ea7f4013 *template/default/member/login.htm
29682968
8c03540906a485367438c4d822536b18 *template/default/member/login_simple.htm
29692969
26cb5ca9b5c4a670b01a17a82897862e *template/default/member/register.htm

source/class/helper/helper_form.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* [Discuz!] (C)2001-2099 Comsenz Inc.
55
* This is NOT a freeware, use is subject to license terms
66
*
7-
* $Id: helper_form.php 34543 2014-05-26 07:33:21Z nemohou $
7+
* $Id: helper_form.php 35375 2015-07-06 02:26:18Z nemohou $
88
*/
99

1010
if(!defined('IN_DISCUZ')) {
@@ -20,8 +20,7 @@ public static function submitcheck($var, $allowget = 0, $seccodecheck = 0, $secq
2020
} else {
2121
global $_G;
2222
if($allowget || ($_SERVER['REQUEST_METHOD'] == 'POST' && !empty($_GET['formhash']) && $_GET['formhash'] == formhash() && empty($_SERVER['HTTP_X_FLASH_VERSION']) && (empty($_SERVER['HTTP_REFERER']) ||
23-
strncmp($_SERVER['HTTP_REFERER'], 'http://wsq.discuz.qq.com', 24) === 0 || strncmp($_SERVER['HTTP_REFERER'], 'http://m.wsq.qq.com', 19) === 0 ||
24-
preg_replace("/https?:\/\/([^\:\/]+).*/i", "\\1", $_SERVER['HTTP_REFERER']) == preg_replace("/([^\:]+).*/", "\\1", $_SERVER['HTTP_HOST'])))) {
23+
strncmp($_SERVER['HTTP_REFERER'], 'http://wsq.discuz.qq.com/', 25) === 0 || preg_replace("/https?:\/\/([^\:\/]+).*/i", "\\1", $_SERVER['HTTP_REFERER']) == preg_replace("/([^\:]+).*/", "\\1", $_SERVER['HTTP_HOST'])))) {
2524
if(checkperm('seccode')) {
2625
if($secqaacheck && !check_secqaa($_GET['secanswer'], $_GET['secqaahash'])) {
2726
showmessage('submit_secqaa_invalid');

source/discuz_version.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* [Discuz!] (C)2001-2099 Comsenz Inc.
55
* This is NOT a freeware, use is subject to license terms
66
*
7-
* $Id: discuz_version.php 35307 2015-06-09 02:15:04Z hypowang $
7+
* $Id: discuz_version.php 35711 2015-12-08 02:32:24Z hypowang $
88
*/
99

1010
if(!defined('IN_DISCUZ')) {
@@ -13,7 +13,7 @@
1313

1414
if(!defined('DISCUZ_VERSION')) {
1515
define('DISCUZ_VERSION', 'X3.2');
16-
define('DISCUZ_RELEASE', '20150609');
16+
define('DISCUZ_RELEASE', '20151208');
1717
define('DISCUZ_FIXBUG', '32000000');
1818
}
1919

source/function/function_cloudaddons.php

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,54 @@
44
* [Discuz!] (C)2001-2099 Comsenz Inc.
55
* This is NOT a freeware, use is subject to license terms
66
*
7-
* $Id: function_cloudaddons.php 34586 2014-06-05 01:45:26Z nemohou $
7+
* $Id: function_cloudaddons.php 35704 2015-12-01 05:13:54Z nemohou $
88
*/
99

1010
if(!defined('IN_DISCUZ')) {
1111
exit('Access Denied');
1212
}
1313

14-
define('CLOUDADDONS_WEBSITE_URL', 'http://addon.discuz.com');
15-
define('CLOUDADDONS_DOWNLOAD_URL', 'http://addon.discuz.com/index.php');
16-
define('CLOUDADDONS_DOWNLOAD_IP', '');
17-
define('CLOUDADDONS_CHECK_URL', 'http://addon1.discuz.com');
18-
define('CLOUDADDONS_CHECK_IP', '');
14+
$addonsource = $_G['config']['addonsource'] ? $_G['config']['addonsource'] : ($_G['setting']['addon_source'] ? $_G['setting']['addon_source'] : array());
15+
$addon = $addonsource ?
16+
$_G['config']['addon'][$addonsource] :
17+
array(
18+
'website_url' => 'http://addon.discuz.com',
19+
'download_url' => 'http://addon.discuz.com/index.php',
20+
'download_ip' => '',
21+
'check_url' => 'http://addon1.discuz.com/md5/',
22+
'check_ip' => '',
23+
);
24+
25+
define('CLOUDADDONS_WEBSITE_URL', $addon['website_url']);
26+
define('CLOUDADDONS_DOWNLOAD_URL', $addon['download_url']);
27+
define('CLOUDADDONS_DOWNLOAD_IP', $addon['download_ip']);
28+
define('CLOUDADDONS_CHECK_URL', $addon['check_url']);
29+
define('CLOUDADDONS_CHECK_IP', $addon['check_ip']);
1930

2031
function cloudaddons_md5($file) {
21-
return dfsockopen(CLOUDADDONS_CHECK_URL.'/md5/'.$file, 0, '', '', false, CLOUDADDONS_CHECK_IP, 60);
32+
return dfsockopen(CLOUDADDONS_CHECK_URL.$file, 0, '', '', false, CLOUDADDONS_CHECK_IP, 60);
2233
}
2334

35+
function cloudaddons_getuniqueid() {
36+
global $_G;
37+
if(CLOUDADDONS_WEBSITE_URL == 'http://addon.discuz.com') {
38+
return $_G['setting']['siteuniqueid'] ? $_G['setting']['siteuniqueid'] : C::t('common_setting')->fetch('siteuniqueid');
39+
} else {
40+
if(!$_G['setting']['addon_uniqueid']) {
41+
$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
42+
$addonuniqueid = $chars[date('y')%60].$chars[date('n')].$chars[date('j')].$chars[date('G')].$chars[date('i')].$chars[date('s')].substr(md5($_G['clientip'].TIMESTAMP), 0, 4).random(6);
43+
C::t('common_setting')->update('addon_uniqueid', $addonuniqueid);
44+
require_once libfile('function/cache');
45+
updatecache('setting');
46+
}
47+
return $_G['setting']['addon_uniqueid'];
48+
}
49+
}
2450
function cloudaddons_url($extra) {
2551
global $_G;
2652

2753
require_once DISCUZ_ROOT.'./source/discuz_version.php';
28-
29-
$uniqueid = $_G['setting']['siteuniqueid'] ? $_G['setting']['siteuniqueid'] : C::t('common_setting')->fetch('siteuniqueid');
30-
$data = 'siteuniqueid='.rawurlencode($uniqueid).'&siteurl='.rawurlencode($_G['siteurl']).'&sitever='.DISCUZ_VERSION.'/'.DISCUZ_RELEASE.'&sitecharset='.CHARSET.'&mysiteid='.$_G['setting']['my_siteid'];
54+
$data = 'siteuniqueid='.rawurlencode(cloudaddons_getuniqueid()).'&siteurl='.rawurlencode($_G['siteurl']).'&sitever='.DISCUZ_VERSION.'/'.DISCUZ_RELEASE.'&sitecharset='.CHARSET.'&mysiteid='.$_G['setting']['my_siteid'];
3155
$param = 'data='.rawurlencode(base64_encode($data));
3256
$param .= '&md5hash='.substr(md5($data.TIMESTAMP), 8, 8).'&timestamp='.TIMESTAMP;
3357
return CLOUDADDONS_DOWNLOAD_URL.'?'.$param.$extra;
@@ -37,12 +61,6 @@ function cloudaddons_check() {
3761
if(!function_exists('gzuncompress')) {
3862
cpmsg('cloudaddons_check_gzuncompress_error', '', 'error');
3963
}
40-
if(dfsockopen(CLOUDADDONS_WEBSITE_URL.'/image/logo.png', 4, '', '', false, CLOUDADDONS_DOWNLOAD_IP, 60) !== chr(0x89).'PNG') {
41-
cpmsg('cloudaddons_check_url_fopen_error', '', 'error');
42-
}
43-
if(dfsockopen(CLOUDADDONS_CHECK_URL.'/logo.png', 4, '', '', false, CLOUDADDONS_CHECK_IP, 60) !== chr(0x89).'PNG') {
44-
cpmsg('cloudaddons_check_url_fopen_error', '', 'error');
45-
}
4664
foreach(array('download', 'addonmd5') as $path) {
4765
$tmpdir = DISCUZ_ROOT.'./data/'.$path.'/'.random(5);
4866
$tmpfile = $tmpdir.'/index.html';

source/function/function_core.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* [Discuz!] (C)2001-2099 Comsenz Inc.
55
* This is NOT a freeware, use is subject to license terms
66
*
7-
* $Id: function_core.php 35297 2015-06-05 03:28:45Z hypowang $
7+
* $Id: function_core.php 35335 2015-06-17 01:57:38Z hypowang $
88
*/
99

1010
if(!defined('IN_DISCUZ')) {
@@ -518,6 +518,7 @@ function checktplrefresh($maintpl, $subtpl, $timecompare, $templateid, $cachefil
518518

519519
function template($file, $templateid = 0, $tpldir = '', $gettplfile = 0, $primaltpl='') {
520520
global $_G;
521+
521522
static $_init_style = false;
522523
if($_init_style === false) {
523524
C::app()->_init_style();
@@ -636,7 +637,6 @@ function template($file, $templateid = 0, $tpldir = '', $gettplfile = 0, $primal
636637
if($gettplfile) {
637638
return $tplfile;
638639
}
639-
640640
checktplrefresh($tplfile, $tplfile, @filemtime(DISCUZ_ROOT.$cachefile), $templateid, $cachefile, $tpldir, $file);
641641
return DISCUZ_ROOT.$cachefile;
642642
}
@@ -1524,7 +1524,7 @@ function dreferer($default = '') {
15241524
}
15251525

15261526
$_G['referer'] = durlencode($_G['referer']);
1527-
return$_G['referer'];
1527+
return $_G['referer'];
15281528
}
15291529

15301530
function ftpcmd($cmd, $arg1 = '') {

0 commit comments

Comments
 (0)