From 00075f9bb77b7cf6c01ce4aa550229f6207ef5ef Mon Sep 17 00:00:00 2001 From: xushubieli Date: Wed, 11 May 2022 15:17:51 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=AD=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.php | 2 +- src/system/helpers/code.helper.php | 48 ++++++++-------- src/system/libraries/mail.class.php | 68 +++++++++++------------ src/theme/plus/download_links_templet.htm | 4 +- src/theme/plus/flink-add.htm | 4 +- src/theme/plus/flink-list.htm | 4 +- src/theme/plus/heightsearch.htm | 4 +- src/theme/plus/recommend.htm | 4 +- src/theme/plus/view_msg.htm | 4 +- 9 files changed, 69 insertions(+), 73 deletions(-) diff --git a/src/index.php b/src/index.php index 587e5f01..2403bba6 100755 --- a/src/index.php +++ b/src/index.php @@ -10,7 +10,7 @@ if (!file_exists(dirname(__FILE__).'/data/common.inc.php')) { header('Location:install/index.php'); exit(); } -//自动生成网页版 +//自动生成网页 if (isset($_GET['upcache']) || !file_exists('index.html')) { require_once(dirname(__FILE__)."/system/common.inc.php"); require_once DEDEINC."/archive/partview.class.php"; diff --git a/src/system/helpers/code.helper.php b/src/system/helpers/code.helper.php index 36e9f70a..9a602cf5 100644 --- a/src/system/helpers/code.helper.php +++ b/src/system/helpers/code.helper.php @@ -1,10 +1,10 @@ '); + $tokens = token_get_all(''); $errors = array(); $braces = 0; foreach ($tokens as $token) { @@ -421,13 +417,13 @@ function checkCode($code) switch ($id) { case ('T_STRING'): if (in_array(strtolower($token[1]), $allowedCalls) === false) { - $errors[$i]['name'] = 'Illegal function: ' . $token[1]; + $errors[$i]['name'] = 'Illegal function: '.$token[1]; $errors[$i]['line'] = $token[2]; } break; default: if (in_array($id, $allowedTokens) === false) { - $errors[$i]['name'] = 'Illegal token: ' . $token[1]; + $errors[$i]['name'] = 'Illegal token: '.$token[1]; $errors[$i]['line'] = $token[2]; } break; @@ -439,21 +435,21 @@ function checkCode($code) return $errors; } } -// 错误提示 +//错误提示 function htmlErrors($errors = null) { if ($errors) { $errorsHTML = "
"; - $errorsHTML .= 'PHP内嵌脚本错误:'; + $errorsHTML .= '内嵌脚本缺失,请添加该函数:'; $errorsHTML .= '
'; foreach ($errors as $error) { if ($error['line']) { - $errorsHTML .= '
Line ' . $error['line'] . '
'; + $errorsHTML .= '
Line '.$error['line'].'
'; } - $errorsHTML .= '
' . $error['name'] . '
'; + $errorsHTML .= '
'.$error['name'].'
'; } $errorsHTML .= '
'; $errorsHTML .= "
\r\n"; echo $errorsHTML; } -} +} \ No newline at end of file diff --git a/src/system/libraries/mail.class.php b/src/system/libraries/mail.class.php index dee82347..c91bda66 100755 --- a/src/system/libraries/mail.class.php +++ b/src/system/libraries/mail.class.php @@ -50,16 +50,16 @@ class smtp } if ($cc != "") { - $header .= "Cc: " . $cc . "\r\n"; + $header .= "Cc: ".$cc."\r\n"; } - $header .= "From: $webname<" . $from . ">\r\n"; - $subject = "=?" . $GLOBALS['cfg_soft_lang'] . "?B?" . base64_encode($subject) . "?="; - $header .= "Subject: " . $subject . "\r\n"; + $header .= "From: $webname<".$from.">\r\n"; + $subject = "=?".$GLOBALS['cfg_soft_lang']."?B?".base64_encode($subject)."?="; + $header .= "Subject: ".$subject."\r\n"; $header .= $additional_headers; - $header .= "Date: " . date("r") . "\r\n"; - $header .= "X-Mailer:By Redhat (PHP/" . phpversion() . ")\r\n"; + $header .= "Date: ".date("r")."\r\n"; + $header .= "X-Mailer:By Redhat (PHP/".phpversion().")\r\n"; list($msec, $sec) = explode(" ", microtime()); - $header .= "Message-ID: <" . date("YmdHis", $sec) . "." . ($msec * 1000000) . "." . $mail_from . ">\r\n"; + $header .= "Message-ID: <".date("YmdHis", $sec).".".($msec * 1000000).".".$mail_from.">\r\n"; $TO = explode(",", $this->strip_comment($to)); if ($cc != "") { @@ -72,20 +72,20 @@ class smtp $sent = TRUE; foreach ($TO as $rcpt_to) { - $headerto = "To: " . $rcpt_to . "\r\n"; - $headerall = $header . $headerto; + $headerto = "To: ".$rcpt_to."\r\n"; + $headerall = $header.$headerto; $rcpt_to = $this->get_address($rcpt_to); if (!$this->smtp_sockopen($rcpt_to)) { - $this->log_write("Error: Cannot send email to " . $rcpt_to . "\n"); + $this->log_write("Error: Cannot send email to ".$rcpt_to."\n"); $sent = FALSE; continue; } if ($this->smtp_send($this->host_name, $mail_from, $rcpt_to, $headerall, $body)) { - $this->log_write("E-mail has been sent to <" . $rcpt_to . ">\n"); + $this->log_write("E-mail has been sent to <".$rcpt_to.">\n"); } else { - $this->log_write("Error: Cannot send email to <" . $rcpt_to . ">\n"); + $this->log_write("Error: Cannot send email to <".$rcpt_to.">\n"); $sent = FALSE; } fclose($this->sock); @@ -125,11 +125,11 @@ class smtp return $this->smtp_error("sending HELO command"); } } - if (!$this->smtp_putcmd("MAIL", "FROM:<" . $from . ">")) + if (!$this->smtp_putcmd("MAIL", "FROM:<".$from.">")) { return $this->smtp_error("sending MAIL FROM command"); } - if (!$this->smtp_putcmd("RCPT", "TO:<" . $to . ">")) + if (!$this->smtp_putcmd("RCPT", "TO:<".$to.">")) { return $this->smtp_error("sending RCPT TO command"); } @@ -162,15 +162,15 @@ class smtp } function smtp_sockopen_relay() { - $this->log_write("Trying to " . $this->relay_host . ":" . $this->smtp_port . "\n"); + $this->log_write("Trying to ".$this->relay_host.":".$this->smtp_port."\n"); $this->sock = @fsockopen($this->relay_host, $this->smtp_port, $errno, $errstr, $this->time_out); if (!($this->sock && $this->smtp_ok())) { - $this->log_write("Error: Cannot connenct to relay host " . $this->relay_host . "\n"); - $this->log_write("Error: " . $errstr . " (" . $errno . ")\n"); + $this->log_write("Error: Cannot connenct to relay host ".$this->relay_host."\n"); + $this->log_write("Error: ".$errstr." (".$errno.")\n"); return FALSE; } - $this->log_write("Connected to relay host " . $this->relay_host . "\n"); + $this->log_write("Connected to relay host ".$this->relay_host."\n"); return TRUE;; } function smtp_sockopen_mx($address) @@ -178,29 +178,29 @@ class smtp $domain = preg_replace("/^.+@([^@]+)$/i", "\1", $address); if (!@getmxrr($domain, $MXHOSTS)) { - $this->log_write("Error: Cannot resolve MX \"" . $domain . "\"\n"); + $this->log_write("Error: Cannot resolve MX \"".$domain."\"\n"); return FALSE; } foreach ($MXHOSTS as $host) { - $this->log_write("Trying to " . $host . ":" . $this->smtp_port . "\n"); + $this->log_write("Trying to ".$host.":".$this->smtp_port."\n"); $this->sock = @fsockopen($host, $this->smtp_port, $errno, $errstr, $this->time_out); if (!($this->sock && $this->smtp_ok())) { - $this->log_write("Warning: Cannot connect to mx host " . $host . "\n"); - $this->log_write("Error: " . $errstr . " (" . $errno . ")\n"); + $this->log_write("Warning: Cannot connect to mx host ".$host."\n"); + $this->log_write("Error: ".$errstr." (".$errno.")\n"); continue; } - $this->log_write("Connected to mx host " . $host . "\n"); + $this->log_write("Connected to mx host ".$host."\n"); return TRUE; } - $this->log_write("Error: Cannot connect to any mx hosts (" . implode(", ", $MXHOSTS) . ")\n"); + $this->log_write("Error: Cannot connect to any mx hosts (".implode(", ", $MXHOSTS).")\n"); return FALSE; } function smtp_message($header, $body) { - fputs($this->sock, $header . "\r\n" . $body); - $this->smtp_debug("> " . str_replace("\r\n", "\n" . "> ", $header . "\n> " . $body . "\n> ")); + fputs($this->sock, $header."\r\n".$body); + $this->smtp_debug("> ".str_replace("\r\n", "\n"."> ", $header."\n> ".$body."\n> ")); return TRUE; } function smtp_eom() @@ -212,12 +212,12 @@ class smtp function smtp_ok() { $response = str_replace("\r\n", "", fgets($this->sock, 512)); - $this->smtp_debug($response . "\n"); + $this->smtp_debug($response."\n"); if (!preg_match("#^[23]#", $response)) { fputs($this->sock, "QUIT\r\n"); fgets($this->sock, 512); - $this->log_write("Error: Remote host returned \"" . $response . "\"\n"); + $this->log_write("Error: Remote host returned \"".$response."\"\n"); return FALSE; } return TRUE; @@ -230,16 +230,16 @@ class smtp { $cmd = $arg; } else { - $cmd = $cmd . " " . $arg; + $cmd = $cmd." ".$arg; } } - fputs($this->sock, $cmd . "\r\n"); - $this->smtp_debug("> " . $cmd . "\n"); + fputs($this->sock, $cmd."\r\n"); + $this->smtp_debug("> ".$cmd."\n"); return $this->smtp_ok(); } function smtp_error($string) { - $this->log_write("Error: Error occurred while " . $string . ".\n"); + $this->log_write("Error: Error occurred while ".$string.".\n"); return FALSE; } function log_write($message) @@ -249,10 +249,10 @@ class smtp { return TRUE; } - $message = date("M d H:i:s ") . get_current_user() . "[" . getmypid() . "]: " . $message; + $message = date("M d H:i:s ").get_current_user()."[".getmypid()."]: ".$message; if (!@file_exists($this->log_file) || !($fp = @fopen($this->log_file, "a"))) { - $this->smtp_debug("Warning: Cannot open log file \"" . $this->log_file . "\"\n"); + $this->smtp_debug("Warning: Cannot open log file \"".$this->log_file."\"\n"); return FALSE;; } flock($fp, LOCK_EX); diff --git a/src/theme/plus/download_links_templet.htm b/src/theme/plus/download_links_templet.htm index ec3a281a..6adff872 100644 --- a/src/theme/plus/download_links_templet.htm +++ b/src/theme/plus/download_links_templet.htm @@ -15,7 +15,7 @@ - +

文件:

@@ -32,6 +32,6 @@
- + \ No newline at end of file diff --git a/src/theme/plus/flink-add.htm b/src/theme/plus/flink-add.htm index 1f3c8cfb..546cc914 100644 --- a/src/theme/plus/flink-add.htm +++ b/src/theme/plus/flink-add.htm @@ -10,7 +10,7 @@ - +
- + \ No newline at end of file diff --git a/src/theme/plus/flink-list.htm b/src/theme/plus/flink-list.htm index 115ddff0..c4ba5ad7 100644 --- a/src/theme/plus/flink-list.htm +++ b/src/theme/plus/flink-list.htm @@ -10,7 +10,7 @@ - +
- + \ No newline at end of file diff --git a/src/theme/plus/heightsearch.htm b/src/theme/plus/heightsearch.htm index 19d490e7..a0d0bb2e 100644 --- a/src/theme/plus/heightsearch.htm +++ b/src/theme/plus/heightsearch.htm @@ -9,7 +9,7 @@ - +
@@ -101,6 +101,6 @@
- + \ No newline at end of file diff --git a/src/theme/plus/recommend.htm b/src/theme/plus/recommend.htm index af1b51f9..46130103 100644 --- a/src/theme/plus/recommend.htm +++ b/src/theme/plus/recommend.htm @@ -9,7 +9,7 @@ - +
推荐:
@@ -42,6 +42,6 @@
- + \ No newline at end of file diff --git a/src/theme/plus/view_msg.htm b/src/theme/plus/view_msg.htm index 46e5d2a0..3cc39e99 100644 --- a/src/theme/plus/view_msg.htm +++ b/src/theme/plus/view_msg.htm @@ -10,7 +10,7 @@ - +
@@ -43,6 +43,6 @@
- + \ No newline at end of file From c41aaefdef4a4d5cb40a83d7abf758deb300123d Mon Sep 17 00:00:00 2001 From: xushubieli Date: Wed, 11 May 2022 17:01:21 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E7=99=BE=E5=BA=A6?= =?UTF-8?q?=E6=96=B0=E9=97=BB=EF=BC=8C=E5=B8=B8=E8=A7=84=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/admin/baidunews.php | 76 ------- src/admin/dialog/select_templets_post.php | 4 +- src/admin/shops_operations_cart.php | 4 +- src/admin/shops_operations_userinfo.php | 6 +- src/admin/templets/action_search.htm | 2 +- src/admin/templets/baidunews.htm | 41 ---- src/admin/templets/friendlink_type.htm | 3 +- src/admin/templets/member_main.htm | 2 +- src/admin/templets/stepselect_main.htm | 2 +- src/admin/templets/update_guide_getfiles.htm | 2 +- src/data/config.file.inc.php | 56 +---- src/install/sql-dfdata.txt | 204 +++++++++---------- src/system/libraries/agent.class.php | 93 ++------- src/system/libraries/crawlerdetect.class.php | 30 +-- src/system/libraries/statistics.class.php | 27 +-- src/user/ajax_feedback.php | 6 +- src/user/operation.php | 1 - 17 files changed, 156 insertions(+), 403 deletions(-) delete mode 100644 src/admin/baidunews.php delete mode 100644 src/admin/templets/baidunews.htm diff --git a/src/admin/baidunews.php b/src/admin/baidunews.php deleted file mode 100644 index c2bf19de..00000000 --- a/src/admin/baidunews.php +++ /dev/null @@ -1,76 +0,0 @@ -\n"; - $baidunews .= "\n"; - $baidunews .= "$cfg_webname \n"; - $baidunews .= "$cfg_adminemail \n"; - $baidunews .= "$cfg_updateperi \n"; - $limit = $cfg_baidunews_limit; - if ($limit > 100 || $limit < 1) { - $limit = 100; - } - $query = "SELECT maintable.*, addtable.body, arctype.typename - FROM `#@__archives` maintable - LEFT JOIN `#@__addonarticle` addtable ON addtable.aid=maintable.id - LEFT JOIN `#@__arctype` arctype ON arctype.ID=maintable.typeid - WHERE maintable.channel=1 and maintable.arcrank!=-1 ORDER BY maintable.pubdate DESC LIMIT $limit - "; - $dsql->SetQuery($query); - $dsql->Execute(); - $proto = IsSSL()? "https://" : "http://"; - while ($row = $dsql->GetArray()) { - $title = dede_htmlspecialchars($row['title']); - $row1 = GetOneArchive($row['id']); - if ((strpos($row1['arcurl'], 'http://') === false) || (strpos($row1['arcurl'], 'https://') === false)) { - $link = ($cfg_basehost == '' ? $proto.$_SERVER["HTTP_HOST"].$cfg_cmspath : $cfg_basehost).$row1['arcurl']; - } else { - $link = $row1['arcurl']; - } - $link = dede_htmlspecialchars($link); - $description = dede_htmlspecialchars(strip_tags($row['description'])); - $text = dede_htmlspecialchars(strip_tags($row['body'])); - $image = $row['litpic'] == '' ? '' : $row['litpic']; - if ($image != '' && (strpos($image, 'http://') === false) || (strpos($image, 'https://') === false)) { - $image = ($cfg_basehost == '' ? $proto.$_SERVER["HTTP_HOST"].$cfg_cmspath : $cfg_basehost).$image; - } - //$headlineimg = ''; - $keywords = dede_htmlspecialchars($row['keywords']); - $category = dede_htmlspecialchars($row['typename']); - $author = dede_htmlspecialchars($row['writer']); - $source = dede_htmlspecialchars($row['source']); - $pubdate = dede_htmlspecialchars(gmdate('Y-m-d H:i', $row['pubdate'] + $cfg_cli_time * 3600)); - $baidunews .= "\n"; - $baidunews .= "$title \n"; - $baidunews .= "$link \n"; - $baidunews .= "$description \n"; - $baidunews .= "$text \n"; - $baidunews .= "$image \n"; - //$baidunews .= "\n"; - $baidunews .= "$keywords \n"; - $baidunews .= "$category \n"; - $baidunews .= "$author \n"; - $baidunews .= "$source \n"; - $baidunews .= "$pubdate \n"; - $baidunews .= "\n"; - } - $baidunews .= "\n"; - $fname = str_replace("//","/",DEDEROOT.$filename) ; - $fp = fopen($fname, 'w'); - fwrite($fp, $baidunews); - fclose($fp); - showmsg("{$filename}生成成功", 'javascript:;'); -} \ No newline at end of file diff --git a/src/admin/dialog/select_templets_post.php b/src/admin/dialog/select_templets_post.php index 525ce3aa..3a291494 100644 --- a/src/admin/dialog/select_templets_post.php +++ b/src/admin/dialog/select_templets_post.php @@ -14,11 +14,11 @@ if (empty($uploadfile)) { $uploadfile = ""; } if (!is_uploaded_file($uploadfile)) { - ShowMsg("您没有选择上传的文件!", "-1"); + ShowMsg("您没有选择上传的文件", "-1"); exit(); } if (!preg_match("#^text#", $uploadfile_type)) { - ShowMsg("您上传的不是文本类型附件!", "-1"); + ShowMsg("您上传的不是文本类型附件", "-1"); exit(); } if (!preg_match("#\.(".$cfg_txttype.")#i", $uploadfile_name)) { diff --git a/src/admin/shops_operations_cart.php b/src/admin/shops_operations_cart.php index 7e7e0416..5151d2bf 100644 --- a/src/admin/shops_operations_cart.php +++ b/src/admin/shops_operations_cart.php @@ -11,9 +11,9 @@ require_once(dirname(__FILE__)."/config.php"); require_once(DEDEINC."/datalistcp.class.php"); CheckPurview('shops_Operations'); -if (!isset($oid)) exit("无效操作!"); +if (!isset($oid)) exit("无效操作"); $oid = preg_replace("#[^-0-9A-Z]#", "", $oid); -if (empty($oid)) exit("无效订单号!"); +if (empty($oid)) exit("无效订单号"); $row = $dsql->GetOne("SELECT * FROM `#@__shops_userinfo` WHERE oid='$oid'"); $sql = "SELECT o.*,p.title,p.price as uprice,d.dname FROM `#@__shops_orders` as o left join `#@__shops_products` as p on o.oid=p.oid left join `#@__shops_delivery` as d on d.pid=o.pid WHERE o.oid='$oid'"; $dlist = new DataListCP(); diff --git a/src/admin/shops_operations_userinfo.php b/src/admin/shops_operations_userinfo.php index 3747191c..a03723c1 100644 --- a/src/admin/shops_operations_userinfo.php +++ b/src/admin/shops_operations_userinfo.php @@ -10,13 +10,13 @@ */ require_once(dirname(__FILE__)."/config.php"); CheckPurview('shops_Operations'); -if (!isset($oid)) exit("无效操作!"); +if (!isset($oid)) exit("无效操作"); $oid = preg_replace("#[^-0-9A-Z]#", "", $oid); -if (empty($oid)) exit("无效订单号!"); +if (empty($oid)) exit("无效订单号"); $rows = $dsql->GetOne("SELECT * FROM `#@__shops_userinfo` WHERE oid='$oid' LIMIT 0,1"); if (!is_array($rows)) { $dsql->Close(); - exit("该订单下没相关用户信息!"); + exit("该订单下没相关用户信息"); } $row = $dsql->GetOne("SELECT pid,dprice FROM `#@__shops_orders` WHERE oid='$oid'"); if (is_array($row)) { diff --git a/src/admin/templets/action_search.htm b/src/admin/templets/action_search.htm index 11df2fea..22b1d907 100644 --- a/src/admin/templets/action_search.htm +++ b/src/admin/templets/action_search.htm @@ -26,7 +26,7 @@
- + diff --git a/src/admin/templets/baidunews.htm b/src/admin/templets/baidunews.htm deleted file mode 100644 index 98141e2d..00000000 --- a/src/admin/templets/baidunews.htm +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - 百度新闻地图 - - - - - -

- - - - - - - - - - - - - - - - - - - -
百度新闻地图
-

《互联网新闻开放协议》是百度新闻搜索制定的搜索引擎新闻源收录标准,网站可将发布的新闻内容制作成遵循此开放协议的XML格式的网页(独立于原有的新闻发布形式)供搜索引擎索引

-

详情参见

-

配置的相关参数在 系统设置-其他选项中调整

-

只适用于文章频道,数据表为V6默认的

-
文件名:
状态: