diff --git a/.gitignore b/.gitignore
index f69b4467..f3efbce0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,7 +14,6 @@ src/install/index.html
src/install/module-install.php.bak
src/a/*/
src/.txt
-src/data/enums/
src/index.html
src/uploads/*.php
src/data/time.lock.inc
@@ -40,3 +39,5 @@ src/data/module/*.php
src/data/*.db
src/uploads/soft/*/
src/static/allimg/*/
+src/data/time.lock
+src/static/enums/*.json
diff --git a/docs/changelog.md b/docs/changelog.md
index 10c88bde..517f8f3e 100644
--- a/docs/changelog.md
+++ b/docs/changelog.md
@@ -1,6 +1,12 @@
# 更新记录
通过访问 https://www.dedebiz.com/git 获取完整更新记录
+# v6.1.1
+- 修正子目录安装问题;
+- 生产环境错误处理调整;
+- 重写联动类型缓存模式&移除对memcache支持;
+- 移除无效资源;
+
# v6.1.0
- 兼容PHP8+;
- 修正已知存在的安全问题;
diff --git a/src/a/.dedekeep b/src/a/.dedekeep
index e69de29b..88302ffc 100644
--- a/src/a/.dedekeep
+++ b/src/a/.dedekeep
@@ -0,0 +1 @@
+DedeBIZ
\ No newline at end of file
diff --git a/src/admin/sys_safetest.php b/src/admin/sys_safetest.php
index 0451e8e2..4977e4e8 100644
--- a/src/admin/sys_safetest.php
+++ b/src/admin/sys_safetest.php
@@ -9,6 +9,7 @@
* @link https://www.dedebiz.com
*/
require_once(dirname(__FILE__).'/config.php');
+require_once(DEDEINC.'/libraries/dedehttpdown.class.php');
CheckPurview('sys_Edit');
if (empty($action)) $action = '';
if (empty($message)) $message = '尚未进行检测……';
@@ -50,10 +51,11 @@ function TestOneFile($f)
if (preg_match("#(".$info.")[ \r\n\t]{0,}([\[\(])#i", $str)) {
$trfile = preg_replace("#^".DEDEROOT."#", '', $f);
$oldTrfile = $trfile;
- $trfile = substr(str_replace("/", "\\", $trfile), 1);
+ $trfile = '/'.substr(str_replace("\\", "/", $trfile), 1);
$localFilehash = md5_file($f);
$remoteFilehash = isset($offFiles[$trfile]) ? $offFiles[$trfile] : '';
+
if ($localFilehash === $remoteFilehash) {
return 0;
}
diff --git a/src/admin/templets/index.htm b/src/admin/templets/index.htm
index 73699c22..88ff44b2 100644
--- a/src/admin/templets/index.htm
+++ b/src/admin/templets/index.htm
@@ -40,7 +40,7 @@
-
-
getUserName(); ?>
+
getUserName(); ?>
退出
授权域名: |
- ${rsp.result.domain}查看 |
+ ${rsp.result.domain} 查看 |
`;
}
diff --git a/src/admin/templets/mychannel_edit.htm b/src/admin/templets/mychannel_edit.htm
index 1f94863b..f4e09124 100644
--- a/src/admin/templets/mychannel_edit.htm
+++ b/src/admin/templets/mychannel_edit.htm
@@ -43,6 +43,13 @@
}
function ShowItem2() {
+ setTimeout(() => {
+ var editor = CodeMirror.fromTextArea(document.getElementById('fieldset'), {
+ lineNumbers: true,
+ lineWrapping: true,
+ mode: 'text/html'
+ });
+ }, 100);
ShowObj('head2'); ShowObj('adset');
HideObj('head1'); HideObj('needset');
}
@@ -50,6 +57,12 @@
+
+
+
+
+
+
diff --git a/src/static/enums/.dedekeep b/src/static/enums/.dedekeep
new file mode 100644
index 00000000..88302ffc
--- /dev/null
+++ b/src/static/enums/.dedekeep
@@ -0,0 +1 @@
+DedeBIZ
\ No newline at end of file
diff --git a/src/system/archive/archives.class.php b/src/system/archive/archives.class.php
index 4cae9136..c86c4ff3 100755
--- a/src/system/archive/archives.class.php
+++ b/src/system/archive/archives.class.php
@@ -67,8 +67,8 @@ class Archives
//如果当前文档不是系统模型,为单表模型
$query = "SELECT arc.*,tp.reid,tp.typedir,ch.addtable
FROM `#@__archives` arc
- LEFT JOIN #@__arctype tp on tp.id=arc.typeid
- LEFT JOIN #@__channeltype as ch on arc.channel = ch.id
+ LEFT JOIN `#@__arctype` tp on tp.id=arc.typeid
+ LEFT JOIN `#@__channeltype` as ch on arc.channel = ch.id
WHERE arc.id='$aid' ";
$this->Fields = $this->dsql->GetOne($query);
} else {
diff --git a/src/system/common.inc.php b/src/system/common.inc.php
index d468240e..4767500d 100755
--- a/src/system/common.inc.php
+++ b/src/system/common.inc.php
@@ -9,14 +9,24 @@
//生产环境使用production,如果采用dev模式,会有一些php的报错信息提示,便于开发调试
define('DEDE_ENVIRONMENT', 'production');
if (DEDE_ENVIRONMENT == 'production') {
- error_reporting(E_ALL || ~E_NOTICE);
+ ini_set('display_errors', 0);
+ if (version_compare(PHP_VERSION, '5.3', '>='))
+ {
+ error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
+ }
+ else
+ {
+ error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE);
+ }
} else {
- error_reporting(E_ALL);
+ error_reporting(-1);
+ ini_set('display_errors', 1);
}
define('DEBUG_LEVEL', FALSE);//如果设置为TRUE则会打印执行SQL的时间和标签加载时间方便调试
define('DEDEINC', str_replace("\\", '/', dirname(__FILE__)));
define('DEDEROOT', str_replace("\\", '/', substr(DEDEINC, 0, -6))); // 站点根目录
define('DEDEDATA', substr(DEDEINC, 0, -6).'data');
+define('DEDESTATIC', DEDEROOT.'/static');
define('DEDEMEMBER', DEDEROOT.'/user');
define('DEDETEMPLATE', DEDEROOT.'/theme');
define('DEDEBIZURL', "https://www.dedebiz.com");//Dede商业支持
@@ -31,9 +41,6 @@ NQabUzX9JoYtXqPcpZRT7ymHrppU0KFdUSEJiW0utTWJo0HrDOBIT5qWlM0MP9p/
PwIDAQAB
-----END PUBLIC KEY-----'); //DedeBIZ系统公钥
define('DEDECDNURL', 'https://cdn.dedebiz.com'); //默认静态资源地址
-if (version_compare(PHP_VERSION, '5.3.0', '<') && function_exists("get_magic_quotes_gpc")) {
- set_magic_quotes_runtime(0);
-}
if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
if (!function_exists('session_register')) {
function session_register()
@@ -59,42 +66,25 @@ if (function_exists('mb_substr')) $cfg_is_mb = TRUE;
if (function_exists('iconv_substr')) $cfg_is_iconv = TRUE;
function _RunMagicQuotes(&$svar)
{
- if (function_exists("get_magic_quotes_gpc") && !@get_magic_quotes_gpc()) {
- if (is_array($svar)) {
- foreach ($svar as $_k => $_v) $svar[$_k] = _RunMagicQuotes($_v);
- } else {
- if (strlen($svar) > 0 && preg_match('#^(cfg_|GLOBALS|_GET|_POST|_COOKIE|_SESSION)#', $svar)) {
- exit('Request var not allow!');
- }
- $svar = addslashes($svar);
+ if (is_array($svar)) {
+ foreach ($svar as $_k => $_v) {
+ if ($_k == 'nvarname') continue;
+ _RunMagicQuotes($_k);
+ $svar[$_k] = _RunMagicQuotes($_v);
+ }
+ } else {
+ if (strlen($svar) > 0 && preg_match('#^(cfg_|GLOBALS|_GET|_REQUEST|_POST|_COOKIE|_SESSION)#', $svar)) {
+ exit('Request var not allow!');
}
+ $svar = addslashes($svar);
}
return $svar;
}
-if (!defined('DEDEREQUEST')) {
- //检查和注册外部提交的变量(2011.8.10 修改登录时相关过滤)
- function CheckRequest(&$val)
- {
- if (is_array($val)) {
- foreach ($val as $_k => $_v) {
- if ($_k == 'nvarname') continue;
- CheckRequest($_k);
- CheckRequest($val[$_k]);
- }
- } else {
- if (strlen($val) > 0 && preg_match('#^(cfg_|GLOBALS|_GET|_POST|_COOKIE|_SESSION)#', $val)) {
- exit('Request var not allow!');
- }
- }
- }
- //var_dump($_REQUEST);exit;
- CheckRequest($_REQUEST);
- CheckRequest($_COOKIE);
- foreach (array('_GET', '_POST', '_COOKIE') as $_request) {
- foreach ($$_request as $_k => $_v) {
- if ($_k == 'nvarname') ${$_k} = $_v;
- else ${$_k} = _RunMagicQuotes($_v);
- }
+
+foreach (array('_GET', '_POST', '_COOKIE') as $_req) {
+ foreach ($$_req as $_k => $_v) {
+ if ($_k == 'nvarname') ${$_k} = $_v;
+ else ${$_k} = _RunMagicQuotes($_v);
}
}
//系统相关变量检测
@@ -194,7 +184,7 @@ $cfg_soft_dir = $cfg_medias_dir.'/soft';
$cfg_other_medias = $cfg_medias_dir.'/media';
//软件摘要信息,****请不要删除本项**** 否则系统无法正确接收系统漏洞或升级信息
$cfg_version = 'V6';
-$cfg_version_detail = '6.1.0'; //详细版本号
+$cfg_version_detail = '6.1.1'; //详细版本号
$cfg_soft_lang = 'utf-8';
$cfg_soft_public = 'base';
$cfg_softname = '织梦内容管理系统';
@@ -231,21 +221,11 @@ if (isset($GLOBALS['PageNo'])) {
if (isset($GLOBALS['TotalResult'])) {
$GLOBALS['TotalResult'] = intval($GLOBALS['TotalResult']);
}
-//设定缓存配置信息
-if ($cfg_memcache_enable == 'Y') {
- $cache_helper_config = array();
- $cache_helper_config['memcache']['is_mc_enable'] = $GLOBALS["cfg_memcache_enable"];
- $cache_helper_config['memcache']['mc'] = array(
- 'default' => $GLOBALS["cfg_memcache_mc_defa"],
- 'other' => $GLOBALS["cfg_memcache_mc_oth"]
- );
- $cache_helper_config['memcache']['mc_cache_time'] = $GLOBALS["cfg_puccache_time"];
-}
+
if (!isset($cfg_NotPrintHead)) {
if (PHP_SAPI != 'cli') {
header("Content-Type: text/html; charset={$cfg_soft_lang}");
}
-
}
//自动加载类库处理
if (version_compare(PHP_VERSION, '7.2.0', '>=')) {
diff --git a/src/system/customfields.func.php b/src/system/customfields.func.php
index 0caadb88..c4c7f13e 100755
--- a/src/system/customfields.func.php
+++ b/src/system/customfields.func.php
@@ -49,8 +49,15 @@ function GetFormItem($ctag, $admintype = 'admin')
$myformItem .= ''."\r\n";
$GLOBALS['hasSetEnumJs'] = 'hasset';
}
- $myformItem .= "\r\n";
- $myformItem .= ''."\r\n";
+ $myformItem .= "\r\n";
$formitem = str_replace('~name~', $ctag->GetAtt('itemname'), $formitem);
$formitem = str_replace('~form~', $myformItem, $formitem);
return $formitem;
@@ -328,8 +335,15 @@ function GetFormItemValue($ctag, $fvalue, $admintype = 'admin', $fieldname = '')
$myformItem .= ''."\r\n";
$GLOBALS['hasSetEnumJs'] = 'hasset';
}
- $myformItem .= "\r\n";
- $myformItem .= "\r\n";
+ $myformItem .= "\r\n";
$formitem = str_replace('~name~', $ctag->GetAtt('itemname'), $formitem);
$formitem = str_replace('~form~', $myformItem, $formitem);
return $formitem;
diff --git a/src/system/enums.func.php b/src/system/enums.func.php
index 377a07fd..0df84901 100755
--- a/src/system/enums.func.php
+++ b/src/system/enums.func.php
@@ -33,22 +33,19 @@ function WriteEnumsCache($egroup = '')
$egroups[] = $nrow['egroup'];
}
foreach ($egroups as $egroup) {
- $cachefile = DEDEDATA.'/enums/'.$egroup.'.php';
- $fp = fopen($cachefile, 'w');
- fwrite($fp, '<'."?php\r\nglobal \$em_{$egroup}s;\r\n\$em_{$egroup}s = array();\r\n");
+ $cachefile = DEDESTATIC.'/enums/'.$egroup.'.json';
$dsql->SetQuery("SELECT ename,evalue,issign FROM `#@__sys_enum` WHERE egroup='$egroup' ORDER BY disorder ASC, evalue ASC ");
$dsql->Execute('enum');
$issign = -1;
$tenum = false; //三级联动标识
+ $data = array();
while ($nrow = $dsql->GetArray('enum')) {
- fwrite($fp, "\$em_{$egroup}s['{$nrow['evalue']}'] = '{$nrow['ename']}';\r\n");
+ $data[$nrow['evalue']] = $nrow['ename'];
if ($issign == -1) $issign = $nrow['issign'];
if ($nrow['issign'] == 2) $tenum = true;
}
+ file_put_contents($cachefile,json_encode($data));
if ($tenum) $dsql->ExecuteNoneQuery("UPDATE `#@__stepselect` SET `issign`=2 WHERE egroup='$egroup'; ");
- fwrite($fp, '?'.'>');
- fclose($fp);
- if (empty($issign)) WriteEnumsJs($egroup);
}
return '成功更新所有枚举缓存';
}
@@ -83,8 +80,11 @@ function GetEnumsTypes($v)
*/
function GetEnumsForm($egroup, $evalue = 0, $formid = '', $seltitle = '')
{
- $cachefile = DEDEDATA.'/enums/'.$egroup.'.php';
- include($cachefile);
+ $cachefile = DEDESTATIC.'/enums/'.$egroup.'.json';
+ $data = json_decode(file_get_contents($cachefile));
+ foreach ($data as $key => $value) {
+ ${'em_'.$egroup.'s'}[$key] = $value;
+ }
if ($formid == '') {
$formid = $egroup;
}
@@ -113,8 +113,11 @@ function GetEnumsForm($egroup, $evalue = 0, $formid = '', $seltitle = '')
function getTopData($egroup)
{
$data = array();
- $cachefile = DEDEDATA.'/enums/'.$egroup.'.php';
- include($cachefile);
+ $cachefile = DEDESTATIC.'/enums/'.$egroup.'.json';
+ $data = json_decode(file_get_contents($cachefile));
+ foreach ($data as $key => $value) {
+ ${'em_'.$egroup.'s'}[$key] = $value;
+ }
foreach (${'em_'.$egroup.'s'} as $k => $v) {
if ($k >= 500 && $k % 500 == 0) {
$data[$k] = $v;
@@ -132,8 +135,12 @@ function getTopData($egroup)
function GetEnumsJs($egroup)
{
global ${'em_'.$egroup.'s'};
- include_once(DEDEDATA.'/enums/'.$egroup.'.php');
- $jsCode = "";
return $jsCode;
}
-/**
- * 写入联动JS代码
- *
- * @access public
- * @param string $egroup 联动组
- * @return string
- */
-function WriteEnumsJs($egroup)
-{
- $jsfile = DEDEDATA.'/enums/'.$egroup.'.js';
- $fp = fopen($jsfile, 'w');
- fwrite($fp, GetEnumsJs($egroup));
- fclose($fp);
-}
+
/**
* 获取枚举的值
*
@@ -171,7 +164,11 @@ function WriteEnumsJs($egroup)
*/
function GetEnumsValue($egroup, $evalue = 0)
{
- include_once(DEDEDATA.'/enums/'.$egroup.'.php');
+ $cachefile = DEDESTATIC.'/enums/'.$egroup.'.json';
+ $data = json_decode(file_get_contents($cachefile));
+ foreach ($data as $key => $value) {
+ ${'em_'.$egroup.'s'}[$key] = $value;
+ }
if (isset(${'em_'.$egroup.'s'}[$evalue])) {
return ${'em_'.$egroup.'s'}[$evalue];
} else {
diff --git a/src/system/helpers/cache.helper.php b/src/system/helpers/cache.helper.php
index 1fbf7052..577f0970 100755
--- a/src/system/helpers/cache.helper.php
+++ b/src/system/helpers/cache.helper.php
@@ -1,7 +1,7 @@
connect($mc_path['host'], $mc_path['port']);
- }
- return $GLOBALS['mc_'.$mc_path['host']]->get($key);
+ // 商业组件缓存
+ if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) {
+ $client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port);
+ $client->appid = $cfg_bizcore_appid;
+ $client->key = $cfg_bizcore_key;
+ $key = trim($prefix.'_'.$key);
+ $data = $client->CacheGet($key);
+ $result = unserialize($data->data);
+ $client->Close();
+ return $result;
}
$key = substr($key, 0, 2).'/'.substr($key, 2, 2).'/'.substr($key, 4, 2).'/'.$key;
$result = @file_get_contents(DEDEDATA."/cache/$prefix/$key.php");
@@ -58,22 +58,20 @@ if (!function_exists('GetCache')) {
* @return int
*/
if (!function_exists('SetCache')) {
- function SetCache($prefix, $key, $value, $timeout = 3600, $is_memcache = TRUE)
+ function SetCache($prefix, $key, $value, $timeout = 3600)
{
- global $cache_helper_config;
+ global $cfg_bizcore_appid, $cfg_bizcore_key, $cfg_bizcore_hostname, $cfg_bizcore_port;
$key = md5($key);
- //如果启用MC缓存
- if (!empty($cache_helper_config['memcache']) && $cache_helper_config['memcache']['is_mc_enable'] === 'Y' && $is_memcache === TRUE) {
- $mc_path = empty($cache_helper_config['memcache']['mc'][substr($key, 0, 1)]) ? $cache_helper_config['memcache']['mc']['default'] : $cache_helper_config['memcache']['mc'][substr($key, 0, 1)];
- $mc_path = parse_url($mc_path);
- $key = ltrim($mc_path['path'], '/').'_'.$prefix.'_'.$key;
- if (empty($GLOBALS['mc_'.$mc_path['host']])) {
- $GLOBALS['mc_'.$mc_path['host']] = new Memcache();
- $GLOBALS['mc_'.$mc_path['host']]->connect($mc_path['host'], $mc_path['port']);
- //设置数据压缩门槛
- //$GLOBALS ['mc_'.$mc_path ['host']]->setCompressThreshold(2048, 0.2);
- }
- $result = $GLOBALS['mc_'.$mc_path['host']]->set($key, $value, MEMCACHE_COMPRESSED, $timeout);
+
+ // 商业组件缓存
+ if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) {
+ $client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port);
+ $client->appid = $cfg_bizcore_appid;
+ $client->key = $cfg_bizcore_key;
+ $key = trim($prefix.'_'.$key);
+ $data = $client->CacheSet($key,serialize($value),$timeout);
+ $result = unserialize($data->data);
+ $client->Close();
return $result;
}
$key = substr($key, 0, 2).'/'.substr($key, 2, 2).'/'.substr($key, 4, 2).'/'.$key;
@@ -89,25 +87,25 @@ if (!function_exists('SetCache')) {
* @access public
* @param string $prefix 前缀
* @param string $key 键
- * @param string $is_memcache 是否为memcache缓存
* @return string
*/
if (!function_exists('DelCache')) {
//删缓存
- function DelCache($prefix, $key, $is_memcache = TRUE)
+ function DelCache($prefix, $key)
{
- global $cache_helper_config;
+ global $cfg_bizcore_appid, $cfg_bizcore_key, $cfg_bizcore_hostname, $cfg_bizcore_port;
+
$key = md5($key);
- //如果启用MC缓存
- if (!empty($cache_helper_config['memcache']) && $cache_helper_config['memcache']['is_mc_enable'] === TRUE && $is_memcache === TRUE) {
- $mc_path = empty($cache_helper_config['memcache']['mc'][substr($key, 0, 1)]) ? $cache_helper_config['memcache']['mc']['default'] : $cache_helper_config['memcache']['mc'][substr($key, 0, 1)];
- $mc_path = parse_url($mc_path);
- $key = ltrim($mc_path['path'], '/').'_'.$prefix.'_'.$key;
- if (empty($GLOBALS['mc_'.$mc_path['host']])) {
- $GLOBALS['mc_'.$mc_path['host']] = new Memcache();
- $GLOBALS['mc_'.$mc_path['host']]->connect($mc_path['host'], $mc_path['port']);
- }
- return $GLOBALS['mc_'.$mc_path['host']]->delete($key);
+
+ // 商业组件缓存
+ if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) {
+ $client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port);
+ $client->appid = $cfg_bizcore_appid;
+ $client->key = $cfg_bizcore_key;
+ $key = trim($prefix.'_'.$key);
+ $data = $client->CacheDel($key);
+ $client->Close();
+ return true;
}
$key = substr($key, 0, 2).'/'.substr($key, 2, 2).'/'.substr($key, 4, 2).'/'.$key;
return @unlink(DEDEDATA."/cache/$prefix/$key.php");
diff --git a/src/system/inc/inc_fun_funAdmin.php b/src/system/inc/inc_fun_funAdmin.php
index 45afe688..1ef98bc8 100755
--- a/src/system/inc/inc_fun_funAdmin.php
+++ b/src/system/inc/inc_fun_funAdmin.php
@@ -146,25 +146,7 @@ function SpGetEditor($fname, $fvalue, $nheight = "350", $etype = "Basic", $gtype
if ($gtype == "") {
$gtype = "print";
}
- if ($GLOBALS['cfg_html_editor'] == 'fck') {
- require_once(DEDEINC.'/FCKeditor/fckeditor.php');
- $fck = new FCKeditor($fname);
- $fck->BasePath = $GLOBALS['cfg_cmspath'].'/include/FCKeditor/';
- $fck->Width = '100%';
- $fck->Height = $nheight;
- $fck->ToolbarSet = $etype;
- $fck->Config['FullPage'] = $isfullpage;
- if ($GLOBALS['cfg_fck_xhtml'] == 'Y') {
- $fck->Config['EnableXHTML'] = 'true';
- $fck->Config['EnableSourceXHTML'] = 'true';
- }
- $fck->Value = $fvalue;
- if ($gtype == "print") {
- $fck->Create();
- } else {
- return $fck->CreateHtml();
- }
- } else if ($GLOBALS['cfg_html_editor'] == 'ckeditor') {
+ if ($GLOBALS['cfg_html_editor'] == 'ckeditor') {
$addConfig = "";
if (defined("DEDEADMIN")) {
$addConfig = ",{allowedContent:true,filebrowserImageUploadUrl:'./dialog/select_images_post.php',filebrowserUploadUrl:'./dialog/select_media_post.php?ck=1',extraPlugins:'html5video,dedepagebreak,ddfilebrowser,mimage,textindent'}";
diff --git a/src/system/libraries/dedebiz.class.php b/src/system/libraries/dedebiz.class.php
index 4bf745e0..96d115f4 100644
--- a/src/system/libraries/dedebiz.class.php
+++ b/src/system/libraries/dedebiz.class.php
@@ -153,7 +153,7 @@ class DedeBizClient
"parms" => array(
"k" => $key,
"v" => $val,
- "d" => $duration,
+ "d" => (string)$duration,
)
);
return $this->request($req);
@@ -244,9 +244,17 @@ class DedeBizClient
function Close()
{
//这里避免重复释放
- if (strtolower(get_resource_type($this->socket)) === "socket") {
- socket_close($this->socket);
- }
+ try {
+ if (strtolower(get_resource_type($this->socket)) === "socket") {
+ socket_close($this->socket);
+ }
+ return true;
+ } catch (TypeError $e) {
+ return false;
+ } catch (Exception $e) {
+ return false;
+ }
+
}
function __destruct()
{
diff --git a/src/system/taglib/channel/stepselect.lib.php b/src/system/taglib/channel/stepselect.lib.php
index 418f3dea..a12dff70 100755
--- a/src/system/taglib/channel/stepselect.lib.php
+++ b/src/system/taglib/channel/stepselect.lib.php
@@ -16,15 +16,10 @@ function ch_stepselect($fvalue, &$arcTag, &$refObj, $fname = '')
function GetEnumsValue2($egroup, $evalue = 0)
{
if (!isset($GLOBALS['em_'.$egroup.'s'])) {
- $cachefile = DEDEDATA.'/enums/'.$egroup.'.php';
- if (!file_exists($cachefile)) {
- require_once(DEDEINC.'/enums.func.php');
- WriteEnumsCache();
- }
- if (!file_exists($cachefile)) {
- return '';
- } else {
- require_once($cachefile);
+ $cachefile = DEDESTATIC.'/enums/'.$egroup.'.json';
+ $data = json_decode(file_get_contents($cachefile));
+ foreach ($data as $key => $value) {
+ $GLOBALS['em_'.$egroup.'s'][$key] = $value;
}
}
if ($evalue >= 500) {
diff --git a/src/system/taglib/infoguide.lib.php b/src/system/taglib/infoguide.lib.php
index 456ee145..bf6c46eb 100755
--- a/src/system/taglib/infoguide.lib.php
+++ b/src/system/taglib/infoguide.lib.php
@@ -43,13 +43,27 @@ function lib_infoguide(&$ctag, &$refObj)
$fields['nativeplace'] .= "\r\n";
$fields['nativeplace'] .= "地区:\r\n";
$fields['nativeplace'] .= "\r\n
\r\n";
- $fields['nativeplace'] .= "\r\n";
- $fields['nativeplace'] .= ''."\r\n";
+ $fields['nativeplace'] .= "\r\n";
$fields['infotype'] .= "\r\n";
$fields['infotype'] .= "类型:\r\n";
$fields['infotype'] .= "
\r\n";
- $fields['infotype'] .= "\r\n";
- $fields['infotype'] .= ''."\r\n";
+ $fields['infotype'] .= "\r\n";
if (is_array($ctp->CTags)) {
foreach ($ctp->CTags as $tagid => $ctag) {
if (isset($fields[$ctag->GetName()])) {
diff --git a/src/system/taglib/infolink.lib.php b/src/system/taglib/infolink.lib.php
index c8e8a96e..0f366cbe 100755
--- a/src/system/taglib/infolink.lib.php
+++ b/src/system/taglib/infolink.lib.php
@@ -10,12 +10,25 @@ if (!defined('DEDEINC')) exit('dedebiz');
* @link https://www.dedebiz.com
*/
require_once(DEDEINC.'/enums.func.php');
-require_once(DEDEDATA.'/enums/nativeplace.php');
-require_once(DEDEDATA.'/enums/infotype.php');
+
+
+$cachefile = DEDESTATIC.'/enums/nativeplace.json';
+$data = json_decode(file_get_contents($cachefile));
+foreach ($data as $key => $value) {
+ $GLOBALS['em_nativeplaces'][$key] = $value;
+}
+
+$cachefile = DEDESTATIC.'/enums/infotype.json';
+$data = json_decode(file_get_contents($cachefile));
+foreach ($data as $key => $value) {
+ $GLOBALS['em_infotypes'][$key] = $value;
+}
+
function lib_infolink(&$ctag, &$refObj)
{
global $dsql, $nativeplace, $infotype, $hasSetEnumJs, $cfg_cmspath, $cfg_mainsite;
global $em_nativeplaces, $em_infotypes;
+
//属性处理
//$attlist="row|12,titlelen|24";
//FillAttsDefault($ctag->CAttribute->Items,$attlist);