diff --git a/admin/admin.inc.php b/admin/admin.inc.php
index afa40e6..5766070 100755
--- a/admin/admin.inc.php
+++ b/admin/admin.inc.php
@@ -770,6 +770,13 @@ auto_delete(); //定时删除
+
-
+
更新内容:
diff --git a/admin/chart.php b/admin/chart.php
index 8a39951..80e6b85 100755
--- a/admin/chart.php
+++ b/admin/chart.php
@@ -122,7 +122,7 @@ if (is_array($char_data)) {
当前版本
-
+
diff --git a/admin/zui.chart.php b/admin/zui.chart.php
index f8aecc4..5c28227 100755
--- a/admin/zui.chart.php
+++ b/admin/zui.chart.php
@@ -120,7 +120,7 @@ if (is_array($char_data)) {
当前版本
-
+
diff --git a/app/Ftp.php b/app/Ftp.php
new file mode 100644
index 0000000..556e485
--- /dev/null
+++ b/app/Ftp.php
@@ -0,0 +1,270 @@
+ 'ssl_connect',
+ 'getoption' => 'get_option',
+ 'setoption' => 'set_option',
+ 'nbcontinue' => 'nb_continue',
+ 'nbfget' => 'nb_fget',
+ 'nbfput' => 'nb_fput',
+ 'nbget' => 'nb_get',
+ 'nbput' => 'nb_put',
+ );
+
+ /** @var resource|\FTP\Connection */
+ private $resource;
+
+ /** @var array */
+ private $state;
+
+ /** @var string */
+ private $errorMsg;
+
+
+ /**
+ * @param string URL ftp://...
+ * @param bool
+ */
+ public function __construct($url = NULL, $passiveMode = TRUE)
+ {
+ if (!extension_loaded('ftp')) {
+ throw new Exception('PHP extension FTP is not loaded.');
+ }
+ if ($url) {
+ $parts = parse_url($url);
+ if (!isset($parts['scheme']) || !in_array($parts['scheme'], array('ftp', 'ftps', 'sftp'))) {
+ throw new InvalidArgumentException('Invalid URL.');
+ }
+ $func = $parts['scheme'] === 'ftp' ? 'connect' : 'ssl_connect';
+ if (empty($parts['port'])) {
+ $this->$func($parts['host']);
+ } else {
+ $this->$func($parts['host'], (int) $parts['port']);
+ }
+ $this->login(urldecode($parts['user']), urldecode($parts['pass']));
+ $this->pasv((bool) $passiveMode);
+ if (isset($parts['path'])) {
+ $this->chdir($parts['path']);
+ }
+ }
+ }
+
+
+ /**
+ * Magic method (do not call directly).
+ * @param string method name
+ * @param array arguments
+ * @return mixed
+ * @throws Exception
+ * @throws FtpException
+ */
+ public function __call($name, $args)
+ {
+ $name = strtolower($name);
+ $silent = strncmp($name, 'try', 3) === 0;
+ $func = $silent ? substr($name, 3) : $name;
+ $func = 'ftp_' . (isset(self::$aliases[$func]) ? self::$aliases[$func] : $func);
+
+ if (!function_exists($func)) {
+ throw new Exception("Call to undefined method Ftp::$name().");
+ }
+
+ $this->errorMsg = NULL;
+ set_error_handler(array($this, '_errorHandler'));
+
+ if ($func === 'ftp_connect' || $func === 'ftp_ssl_connect') {
+ $this->state = array($name => $args);
+ $this->resource = call_user_func_array($func, $args);
+ $res = NULL;
+
+ } elseif (!is_resource($this->resource) && !$this->resource instanceof \FTP\Connection) {
+ restore_error_handler();
+ throw new FtpException("Not connected to FTP server. Call connect() or ssl_connect() first.");
+
+ } else {
+ if ($func === 'ftp_login' || $func === 'ftp_pasv') {
+ $this->state[$name] = $args;
+ }
+
+ array_unshift($args, $this->resource);
+ $res = call_user_func_array($func, $args);
+
+ if ($func === 'ftp_chdir' || $func === 'ftp_cdup') {
+ $this->state['chdir'] = array(ftp_pwd($this->resource));
+ }
+ }
+
+ restore_error_handler();
+ if (!$silent && $this->errorMsg !== NULL) {
+ if (ini_get('html_errors')) {
+ $this->errorMsg = html_entity_decode(strip_tags($this->errorMsg));
+ }
+
+ if (($a = strpos($this->errorMsg, ': ')) !== FALSE) {
+ $this->errorMsg = substr($this->errorMsg, $a + 2);
+ }
+
+ throw new FtpException($this->errorMsg);
+ }
+
+ return $res;
+ }
+
+
+ /**
+ * Internal error handler. Do not call directly.
+ */
+ public function _errorHandler($code, $message)
+ {
+ $this->errorMsg = $message;
+ }
+
+
+ /**
+ * Reconnects to FTP server.
+ * @return void
+ */
+ public function reconnect()
+ {
+ @ftp_close($this->resource); // intentionally @
+ foreach ($this->state as $name => $args) {
+ call_user_func_array(array($this, $name), $args);
+ }
+ }
+
+
+ /**
+ * Checks if file or directory exists.
+ * @param string
+ * @return bool
+ */
+ public function fileExists($file)
+ {
+ return (bool) $this->nlist($file);
+ }
+
+
+ /**
+ * Checks if directory exists.
+ * @param string
+ * @return bool
+ */
+ public function isDir($dir)
+ {
+ $current = $this->pwd();
+ try {
+ $this->chdir($dir);
+ } catch (FtpException $e) {
+ }
+ $this->chdir($current);
+ return empty($e);
+ }
+
+
+ /**
+ * Recursive creates directories.
+ * @param string
+ * @return void
+ */
+ public function mkDirRecursive($dir)
+ {
+ $parts = explode('/', $dir);
+ $path = '';
+ while (!empty($parts)) {
+ $path .= array_shift($parts);
+ try {
+ if ($path !== '') $this->mkdir($path);
+ } catch (FtpException $e) {
+ if (!$this->isDir($path)) {
+ throw new FtpException("Cannot create directory '$path'.");
+ }
+ }
+ $path .= '/';
+ }
+ }
+
+
+ /**
+ * Recursive deletes path.
+ * @param string
+ * @return void
+ */
+ public function deleteRecursive($path)
+ {
+ if (!$this->tryDelete($path)) {
+ foreach ((array) $this->nlist($path) as $file) {
+ if ($file !== '.' && $file !== '..') {
+ $this->deleteRecursive(strpos($file, '/') === FALSE ? "$path/$file" : $file);
+ }
+ }
+ $this->rmdir($path);
+ }
+ }
+
+}
+
+
+
+class FtpException extends Exception
+{
+}
diff --git a/app/check_admin.inc.php b/app/check_admin.inc.php
index e05dd7b..0a98315 100644
--- a/app/check_admin.inc.php
+++ b/app/check_admin.inc.php
@@ -66,7 +66,7 @@ if (!file_exists(__DIR__ . '/ip2region/ip2region.xdb')) {
}
// 检查当前版本与GitHub版本
-if (getVersion() !== get_current_version()) {
+if (getVersion() !== APP_VERSION) {
echo '
new $.zui.Messager("当前版本与GitHub不一致,请检查当前是否最新版本!",{
type: "danger", // 定义颜色主题
diff --git a/app/footer.php b/app/footer.php
index 3c26b21..24ac336 100644
--- a/app/footer.php
+++ b/app/footer.php
@@ -199,7 +199,7 @@ if ($config['notice_status'] > 0) : ?>
});
// console
- console.log("%cEasyImage ", "background: rgba(252,234,187,1);background: -moz-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%,rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 0.5%);background: -webkit-gradient(left top, right top, color-stop(0%, rgba(252,234,187,1)), color-stop(12%, rgba(175,250,77,1)), color-stop(28%, rgba(0,247,49,1)), color-stop(39%, rgba(0,210,247,1)), color-stop(51%, rgba(0,189,247,1)), color-stop(64%, rgba(133,108,217,1)), color-stop(78%, rgba(177,0,247,1)), color-stop(87%, rgba(247,0,189,1)), color-stop(0.5%, rgba(245,22,52,1)));background: -webkit-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 0.5%);background: -o-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 0.5%);background: -ms-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 0.5%);background: linear-gradient(to right, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 0.5%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fceabb', endColorstr='#f51634', GradientType=1 );font-size:2.34em;font-weight:bold")
+ console.log("%cEasyImage ", "background: rgba(252,234,187,1);background: -moz-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%,rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 0.5%);background: -webkit-gradient(left top, right top, color-stop(0%, rgba(252,234,187,1)), color-stop(12%, rgba(175,250,77,1)), color-stop(28%, rgba(0,247,49,1)), color-stop(39%, rgba(0,210,247,1)), color-stop(51%, rgba(0,189,247,1)), color-stop(64%, rgba(133,108,217,1)), color-stop(78%, rgba(177,0,247,1)), color-stop(87%, rgba(247,0,189,1)), color-stop(0.5%, rgba(245,22,52,1)));background: -webkit-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 0.5%);background: -o-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 0.5%);background: -ms-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 0.5%);background: linear-gradient(to right, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 0.5%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fceabb', endColorstr='#f51634', GradientType=1 );font-size:2.34em;font-weight:bold")
console.log('%c图床作者及演示网站: https://png.cm\n作为开发者你可以对相应的后台功能进行扩展(增删改相应代码), 但请保留代码中相关来源信息(例如: 本人博客, 邮箱等);\n本程序由 Icret 独自开发并完全开源, 碰到收费发布的请不要轻易付款; 本人仅为程序开源创作, 如非法网站使用与本人无关, 请勿用于非法用途.%c ', 'color: #eaad1a; padding:5px 0; border:1px solid #448ef6; font-size:12px;', '');