From 00075f9bb77b7cf6c01ce4aa550229f6207ef5ef Mon Sep 17 00:00:00 2001 From: xushubieli Date: Wed, 11 May 2022 15:17:51 +0800 Subject: [PATCH] =?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