diff --git a/src/install/index.php b/src/install/index.php
index b3e68957..17c4b649 100644
--- a/src/install/index.php
+++ b/src/install/index.php
@@ -9,10 +9,7 @@
@set_time_limit(0);
error_reporting(E_ALL || ~E_NOTICE);
define('INSLOCKFILE', dirname(__FILE__).'/install_lock.txt');
-if(file_exists(INSLOCKFILE))
-{
- die("
";
$rmsg .= "
\");";
$rmsg .= "document.write(\"
\");";
- $rmsg .= "document.write(\"".str_replace("\"","“",$msg)."\");";
+ $rmsg .= "document.write(\"" . str_replace("\"", "“", $msg) . "\");";
$rmsg .= "document.write(\"";
- if($onlymsg==0)
- {
- if( $gourl != 'javascript:;' && $gourl != '')
- {
+ if ($onlymsg == 0) {
+ if ($gourl != 'javascript:;' && $gourl != '') {
$rmsg .= "
\");";
$rmsg .= "setTimeout('JumpUrl()',$litime);";
} else {
@@ -248,7 +275,7 @@ function ShowMsg($msg, $gourl, $onlymsg = 0, $limittime = 0)
} else {
$rmsg .= "
\");";
}
- $msg = $htmlhead.$rmsg.$htmlfoot;
+ $msg = $htmlhead . $rmsg . $htmlfoot;
}
echo $msg;
}
@@ -302,119 +329,114 @@ function IsSSL()
}
//自定义函数接口
//这里主要兼容早期的用户扩展,v5.7之后我们建议使用小助手helper进行扩展
-if (file_exists(DEDEINC.'/extend.func.php')) {
- require_once(DEDEINC.'/extend.func.php');
+if (file_exists(DEDEINC . '/extend.func.php')) {
+ require_once(DEDEINC . '/extend.func.php');
}
/**
* 添加多选联动筛选
*
* @return string
*/
-function litimgurls($imgid=0)
+function litimgurls($imgid = 0)
{
- global $lit_imglist,$dsql;
+ global $lit_imglist, $dsql;
$row = $dsql->GetOne("SELECT c.addtable FROM `#@__archives` AS a LEFT JOIN `#@__channeltype` AS c ON a.channel=c.id where a.id='$imgid'");
$addtable = trim($row['addtable']);
$row = $dsql->GetOne("Select imgurls From `$addtable` where aid='$imgid'");
- $ChannelUnit = new ChannelUnit(2,$imgid);
+ $ChannelUnit = new ChannelUnit(2, $imgid);
$lit_imglist = $ChannelUnit->GetlitImgLinks($row['imgurls']);
return $lit_imglist;
}
//字符过滤函数,用于安全
-function string_filter($str,$stype="inject") {
- if ($stype=="inject") {
- $str = str_replace (
- array ("select", "insert", "update", "delete", "alter", "cas", "union", "into", "load_file", "outfile", "create", "join", "where", "like", "drop", "modify", "rename", "'", "/*", "*", "../", "./"),
- array ("","","","","","","","","","","","","","","","","","","","","",""),
- $str);
- } else if ($stype=="xss") {
- $farr = array ("/\s+/" , "/<(\/?)(script|META|STYLE|HTML|HEAD|BODY|STYLE |i?frame|b|strong|style|html|img|P|o:p|iframe|u|em|strike|BR|div|a|TABLE|TBODY|object|tr|td|st1:chsdate|FONT|span|MARQUEE|body|title|\r\n|link|meta|\?|\%)([^>]*?)>/isU", "/(<[^>]*)on[a-zA-Z]+\s*=([^>]*>)/isU",);
- $tarr = array (" ","","\\1\\2",);
- $str = preg_replace ($farr, $tarr, $str);
- $str = str_replace (
- array( "<", ">", "'", "\"", ";", "/*", "*", "../", "./"),
- array("<",">","","","","","","",""),
- $str);
+function string_filter($str, $stype = "inject")
+{
+ if ($stype == "inject") {
+ $str = str_replace(
+ array("select", "insert", "update", "delete", "alter", "cas", "union", "into", "load_file", "outfile", "create", "join", "where", "like", "drop", "modify", "rename", "'", "/*", "*", "../", "./"),
+ array("", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""),
+ $str
+ );
+ } else if ($stype == "xss") {
+ $farr = array("/\s+/", "/<(\/?)(script|META|STYLE|HTML|HEAD|BODY|STYLE |i?frame|b|strong|style|html|img|P|o:p|iframe|u|em|strike|BR|div|a|TABLE|TBODY|object|tr|td|st1:chsdate|FONT|span|MARQUEE|body|title|\r\n|link|meta|\?|\%)([^>]*?)>/isU", "/(<[^>]*)on[a-zA-Z]+\s*=([^>]*>)/isU",);
+ $tarr = array(" ", "", "\\1\\2",);
+ $str = preg_replace($farr, $tarr, $str);
+ $str = str_replace(
+ array("<", ">", "'", "\"", ";", "/*", "*", "../", "./"),
+ array("<", ">", "", "", "", "", "", "", ""),
+ $str
+ );
}
return $str;
}
//载入自定义表单,用于发布
-function AddFilter($channelid, $type=1, $fieldsnamef="", $defaulttid=0, $loadtype='autofield')
+function AddFilter($channelid, $type = 1, $fieldsnamef = "", $defaulttid = 0, $loadtype = 'autofield')
{
- global $tid,$dsql,$id;
+ global $tid, $dsql, $id;
$tid = $defaulttid ? $defaulttid : $tid;
$id = intval($id);
$tid = intval($tid);
$channelid = intval($channelid);
- if ($id!="")
- {
+ if ($id != "") {
$tidsq = $dsql->GetOne("SELECT typeid FROM `#@__archives` WHERE id='$id' ");
$tid = $tidsq["typeid"];
}
- $nofilter = (isset($_REQUEST['TotalResult']) ? "&TotalResult=".(int)$_REQUEST['TotalResult'] : '').(isset($_REQUEST['PageNo']) ? "&PageNo=".(int)$_REQUEST['PageNo'] : '');
- $filterarr = string_filter(stripos($_SERVER['REQUEST_URI'], "list.php?tid=") ? str_replace($nofilter, '', $_SERVER['REQUEST_URI']) : $GLOBALS['cfg_cmsurl']."/apps/list.php?tid=".$tid);
+ $nofilter = (isset($_REQUEST['TotalResult']) ? "&TotalResult=" . (int)$_REQUEST['TotalResult'] : '') . (isset($_REQUEST['PageNo']) ? "&PageNo=" . (int)$_REQUEST['PageNo'] : '');
+ $filterarr = string_filter(stripos($_SERVER['REQUEST_URI'], "list.php?tid=") ? str_replace($nofilter, '', $_SERVER['REQUEST_URI']) : $GLOBALS['cfg_cmsurl'] . "/apps/list.php?tid=" . $tid);
$cInfos = $dsql->GetOne("SELECT * FROM `#@__channeltype` WHERE id='$channelid' ");
- $fieldset=stripslashes($cInfos['fieldset']);
+ $fieldset = stripslashes($cInfos['fieldset']);
$dtp = new DedeTagParse();
- $dtp->SetNameSpace('field','<','>');
+ $dtp->SetNameSpace('field', '<', '>');
$dtp->LoadSource($fieldset);
$dede_addonfields = '';
- if(is_array($dtp->CTags))
- {
- foreach($dtp->CTags as $tida=>$ctag)
- {
+ if (is_array($dtp->CTags)) {
+ foreach ($dtp->CTags as $tida => $ctag) {
$fieldsname = $fieldsnamef ? explode(",", $fieldsnamef) : explode(",", $ctag->GetName());
- if(($loadtype!='autofield' || ($loadtype=='autofield' && $ctag->GetAtt('autofield')==1)) && in_array($ctag->GetName(), $fieldsname) )
- {
- $href1 = explode($ctag->GetName().'=', $filterarr);
+ if (($loadtype != 'autofield' || ($loadtype == 'autofield' && $ctag->GetAtt('autofield') == 1)) && in_array($ctag->GetName(), $fieldsname)) {
+ $href1 = explode($ctag->GetName() . '=', $filterarr);
$href2 = explode('&', $href1[1]);
$fields_value = $href2[0];
$fields_value1 = explode('|', $fields_value);
- $dede_addonfields .= ''.$ctag->GetAtt('itemname').':';
+ $dede_addonfields .= '' . $ctag->GetAtt('itemname') . ':';
switch ($type) {
case 1:
- $dede_addonfields .= (preg_match("/&".$ctag->GetName()."=/is",$filterarr,$regm) ? '
GetName()."=".$fields_value,"",$filterarr).'" style="display:inline-block;padding:.25rem .5rem;line-height:1.5;color:#fff;background:#28a745;border-color:#28a745;border-radius:.2rem">全部' : '
全部').' ';
- $addonfields_items = explode(",",$ctag->GetAtt('default'));
- for ($i=0; $i
GetName().'=') ? str_replace("=".$fields_value,"=".$fields_value."|".urlencode($addonfields_items[$i]),$filterarr) : $filterarr.'&'.$ctag->GetName().'='.urlencode($addonfields_items[$i]);
+ $dede_addonfields .= (preg_match("/&" . $ctag->GetName() . "=/is", $filterarr, $regm) ? 'GetName() . "=" . $fields_value, "", $filterarr) . '" style="display:inline-block;padding:.25rem .5rem;line-height:1.5;color:#fff;background:#28a745;border-color:#28a745;border-radius:.2rem">全部' : '全部') . ' ';
+ $addonfields_items = explode(",", $ctag->GetAtt('default'));
+ for ($i = 0; $i < count($addonfields_items); $i++) {
+ $href = stripos($filterarr, $ctag->GetName() . '=') ? str_replace("=" . $fields_value, "=" . $fields_value . "|" . urlencode($addonfields_items[$i]), $filterarr) : $filterarr . '&' . $ctag->GetName() . '=' . urlencode($addonfields_items[$i]);
$is_select = in_array(urlencode($addonfields_items[$i]), $fields_value1) ? 1 : 0;
$fields_value2 = "";
- for ($j=0; $jGetName()."=".$fields_value,$ctag->GetName()."=".$fields_value, "&".$ctag->GetName()."=&"), array("&".$ctag->GetName()."=".$fields_value2,$ctag->GetName()."=".$fields_value2, "&"), $filterarr);
- $href3 = !end(explode("=", $href3)) ? str_replace("&".end(explode("&", $href3)), "", $href3) : $href3;
-
- $dede_addonfields .= ($fields_value!=urlencode($addonfields_items[$i]) && $is_select!=1 ? ''.$addonfields_items[$i].'' : ''.$addonfields_items[$i].'×')." ";
+ $href3 = str_replace(array("&" . $ctag->GetName() . "=" . $fields_value, $ctag->GetName() . "=" . $fields_value, "&" . $ctag->GetName() . "=&"), array("&" . $ctag->GetName() . "=" . $fields_value2, $ctag->GetName() . "=" . $fields_value2, "&"), $filterarr);
+ $href3 = !end(explode("=", $href3)) ? str_replace("&" . end(explode("&", $href3)), "", $href3) : $href3;
+
+ $dede_addonfields .= ($fields_value != urlencode($addonfields_items[$i]) && $is_select != 1 ? '' . $addonfields_items[$i] . '' : '' . $addonfields_items[$i] . '×') . " ";
}
$dede_addonfields .= '
';
- break;
+ break;
case 2:
- $dede_addonfields .= (preg_match("/&".$ctag->GetName()."=/is",$filterarr,$regm) ? 'GetName()."=".$fields_value,"",$filterarr).'">全部' : '全部').' ';
- $addonfields_items = explode(",",$ctag->GetAtt('default'));
- for ($i=0; $iGetName().'=') ? str_replace("=".$fields_value,"=".$fields_value."|".urlencode($addonfields_items[$i]),$filterarr) : $filterarr.'&'.$ctag->GetName().'='.urlencode($addonfields_items[$i]);
+ $dede_addonfields .= (preg_match("/&" . $ctag->GetName() . "=/is", $filterarr, $regm) ? 'GetName() . "=" . $fields_value, "", $filterarr) . '">全部' : '全部') . ' ';
+ $addonfields_items = explode(",", $ctag->GetAtt('default'));
+ for ($i = 0; $i < count($addonfields_items); $i++) {
+ $href = stripos($filterarr, $ctag->GetName() . '=') ? str_replace("=" . $fields_value, "=" . $fields_value . "|" . urlencode($addonfields_items[$i]), $filterarr) : $filterarr . '&' . $ctag->GetName() . '=' . urlencode($addonfields_items[$i]);
$is_select = in_array(urlencode($addonfields_items[$i]), $fields_value1) ? 1 : 0;
$fields_value2 = "";
- for ($j=0; $jGetName()."=".$fields_value,$ctag->GetName()."=".$fields_value, "&".$ctag->GetName()."=&"), array("&".$ctag->GetName()."=".$fields_value2,$ctag->GetName()."=".$fields_value2, "&"), $filterarr);
- $href3 = !end(explode("=", $href3)) ? str_replace("&".end(explode("&", $href3)), "", $href3) : $href3;
-
- $dede_addonfields .= ($fields_value!=urlencode($addonfields_items[$i]) && $is_select!=1 ? ' '.$addonfields_items[$i].'' : ' '.$addonfields_items[$i].'')." ";
+ $href3 = str_replace(array("&" . $ctag->GetName() . "=" . $fields_value, $ctag->GetName() . "=" . $fields_value, "&" . $ctag->GetName() . "=&"), array("&" . $ctag->GetName() . "=" . $fields_value2, $ctag->GetName() . "=" . $fields_value2, "&"), $filterarr);
+ $href3 = !end(explode("=", $href3)) ? str_replace("&" . end(explode("&", $href3)), "", $href3) : $href3;
+
+ $dede_addonfields .= ($fields_value != urlencode($addonfields_items[$i]) && $is_select != 1 ? ' ' . $addonfields_items[$i] . '' : ' ' . $addonfields_items[$i] . '') . " ";
}
$dede_addonfields .= '
';
- break;
+ break;
}
}
}
}
echo $dede_addonfields;
-}
\ No newline at end of file
+}
diff --git a/src/system/database/dedesqli.class.php b/src/system/database/dedesqli.class.php
index 68029029..356e07c1 100755
--- a/src/system/database/dedesqli.class.php
+++ b/src/system/database/dedesqli.class.php
@@ -217,7 +217,7 @@ class DedeSqli
if (PHP_SAPI === 'cli') {
echo "执行SQL:".$this->queryString.",执行时间:{$queryTime}\r\n";
} else {
- echo "执行SQL:".$this->queryString.",执行时间:{$queryTime}
\r\n";
+ echo DedeAlert("执行SQL:".$this->queryString.",执行时间:{$queryTime}", ALERT_SUCCESS);
}
}
return $rs;
@@ -254,7 +254,7 @@ class DedeSqli
if (PHP_SAPI === 'cli') {
echo "执行SQL:".$this->queryString.",执行时间:{$queryTime}\r\n";
} else {
- echo "执行SQL:".$this->queryString.",执行时间:{$queryTime}
\r\n";
+ echo DedeAlert("执行SQL:".$this->queryString.",执行时间:{$queryTime}", ALERT_SUCCESS);
}
}
return mysqli_affected_rows($this->linkID);
@@ -304,7 +304,7 @@ class DedeSqli
if (PHP_SAPI === 'cli') {
echo "执行SQL:".$this->queryString.",执行时间:{$queryTime}\r\n";
} else {
- echo "执行SQL:".$this->queryString.",执行时间:{$queryTime}
\r\n";
+ echo DedeAlert("执行SQL:".$this->queryString.",执行时间:{$queryTime}", ALERT_SUCCESS);
}
}
if ($this->result[$id] === FALSE) {
diff --git a/src/system/helpers/channelunit.helper.php b/src/system/helpers/channelunit.helper.php
index 7e1d0825..409114fb 100755
--- a/src/system/helpers/channelunit.helper.php
+++ b/src/system/helpers/channelunit.helper.php
@@ -490,7 +490,7 @@ function MakeOneTag(&$dtp, &$refObj, $parfield = 'Y')
if (PHP_SAPI === 'cli') {
echo '标签:'.$tagname.'载入花费时间:'.$queryTime."\r\n";
} else {
- echo '标签:'.$tagname.'载入花费时间:'.$queryTime."
\r\n";
+ echo DedeAlert('标签:'.$tagname.'载入花费时间:'.$queryTime, ALERT_WARNING);
}
}