monkeye 1 an în urmă
părinte
comite
42303edf6f
1 a modificat fișierele cu 1 adăugiri și 81 ștergeri
  1. 1 81
      source/class/discuz/discuz_application.php

+ 1 - 81
source/class/discuz/discuz_application.php

@@ -78,10 +78,6 @@ class discuz_application extends discuz_base {
 			exit('function_core.php is missing');
 		}
 
-		if (!defined('DISCUZ_LOG_FUNCTION') && !@include(DISCUZ_ROOT . './source/function/function_log.php')) {
-			exit('function_log.php is missing');
-		}
-
 		if (function_exists('ini_get')) {
 			$memorylimit = @ini_get('memory_limit');
 			if ($memorylimit && return_bytes($memorylimit) < 33554432 && function_exists('ini_set')) {
@@ -98,18 +94,6 @@ class discuz_application extends discuz_base {
 			}
 		}
 
-		if (!defined('APPTYPEID')) {
-			define('APPTYPEID', 0);
-		}
-
-		if (!defined('DISCUZ_APP')) {
-			define('DISCUZ_APP', '');
-		}
-
-		if (!defined('CURSCRIPT')) {
-			define('CURSCRIPT', DISCUZ_APP);
-		}
-
 		global $_G;
 		$_G = [
 			'uid' => 0,
@@ -126,68 +110,9 @@ class discuz_application extends discuz_base {
 			'referer' => '',
 			'charset' => '',
 			'gzipcompress' => '',
-			'authkey' => '',
-			'timenow' => [],
-			'widthauto' => 0,
-			'disabledwidthauto' => 0,
-
-			'PHP_SELF' => '',
-			'siteurl' => '',
-			'siteroot' => '',
-			'siteport' => '',
-
-			'pluginrunlist' => !defined('PLUGINRUNLIST') ? [] : explode(',', PLUGINRUNLIST),
-
-			'config' => & $this->config,
-			'setting' => [],
-			'member' => [],
-			'group' => [],
-			'cookie' => [],
-			'style' => [],
-			'cache' => [],
-			'session' => [],
-			'lang' => [],
-
-			'fid' => 0,
-			'tid' => 0,
-			'forum' => [],
-			'thread' => [],
-			'rssauth' => '',
-
-			'home' => [],
-			'space' => [],
-
-			'block' => [],
-			'article' => [],
-
-			'action' => [
-				'action' => APPTYPEID,
-				'fid' => 0,
-				'tid' => 0,
-			],
-
-			'mobile' => '',
-			'notice_structure' => [
-				'mypost' => ['post', 'rate', 'pcomment', 'activity', 'reward', 'goods', 'at'],
-				'interactive' => ['poke', 'friend', 'wall', 'comment', 'click', 'sharenotice'],
-				'system' => ['system', 'credit', 'group', 'verify', 'magic', 'task', 'show', 'group', 'pusearticle', 'mod_member', 'blog', 'article'],
-				'manage' => ['mod_member', 'report', 'pmreport'],
-				'app' => [],
-			],
-			'mobiletpl' => ['1' => 'touch', '2' => 'touch', '3' => 'touch', 'yes' => 'touch'],
 		];
 		$_G['PHP_SELF'] = dhtmlspecialchars($this->_get_script_url());
-		$_G['basescript'] = CURSCRIPT;
 		$_G['basefilename'] = basename($_G['PHP_SELF']);
-		$sitepath = substr($_G['PHP_SELF'], 0, strrpos($_G['PHP_SELF'], '/'));
-		if (defined('IN_API')) {
-			$sitepath = preg_replace('/\/api\/?.*?$/i', '', $sitepath);
-		} elseif (defined('IN_ARCHIVER')) {
-			$sitepath = preg_replace('/\/archiver/i', '', $sitepath);
-		}
-		if (defined('IN_NEWMOBILE')) {
-			$sitepath = preg_replace('/\/m/i', '', $sitepath);
-		}
 		$_G['isHTTPS'] = !empty($_G['config']['output']['forcehttps']) || $this->_is_https();
 		$_G['scheme'] = 'http' . ($_G['isHTTPS'] ? 's' : '');
 		$_G['siteurl'] = dhtmlspecialchars($_G['scheme'] . '://' . $_SERVER['HTTP_HOST'] . $sitepath . '/');
@@ -196,11 +121,6 @@ class discuz_application extends discuz_base {
 		$_G['siteroot'] = $url['path'] ?? '';
 		$_G['siteport'] = empty($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == '80' || $_SERVER['SERVER_PORT'] == '443' ? '' : ':' . $_SERVER['SERVER_PORT'];
 
-		if (defined('SUB_DIR')) {
-			$_G['siteurl'] = str_replace(SUB_DIR, '/', $_G['siteurl']);
-			$_G['siteroot'] = str_replace(SUB_DIR, '/', $_G['siteroot']);
-		}
-
 		$this->var = &$_G;
 	}
 
@@ -227,7 +147,7 @@ class discuz_application extends discuz_base {
 
 	private function _init_input() {
 		if (isset($_GET['GLOBALS']) || isset($_POST['GLOBALS']) || isset($_COOKIE['GLOBALS']) || isset($_FILES['GLOBALS'])) {
-			system_error('request_tainting');
+			exit('request tainting');
 		}
 
 		$prelength = strlen($this->config['cookie']['cookiepre']);