From c6cd45425cac47157e27d4c330e48844e7ed2961 Mon Sep 17 00:00:00 2001 From: icret Date: Sun, 10 Jul 2022 22:48:21 +0800 Subject: [PATCH] v2.6.6 --- README.md | 6 + admin/admin.inc.php | 25 ++- admin/chart.php | 0 admin/index.php | 0 admin/manager.php | 0 admin/terms.php | 0 admin/verson.txt | 2 +- admin/zui.chart.php | 0 api/index.php | 0 api/public.php | 0 application/TimThumb.php | 0 application/WaterMask.php | 0 application/captcha.php | 0 application/chart.php | 0 application/check.php | 0 application/check_admin.inc.php | 0 application/class.snowflake.php | 45 +++++ application/class.thumb.php | 0 application/class.upload.php | 164 +++++++++++------- application/class.version.php | 0 .../compress/Imagick/class.Imgcompress.php | 0 application/compress/TinyImg/TinyImg.php | 0 application/compress/TinyImg/cacert.pem | 0 application/compress/function.compress.php | 0 application/compressing.php | 0 application/del.php | 0 application/down.php | 0 application/footer.php | 10 +- application/function.php | 4 + application/header.php | 0 application/hide.php | 0 application/info.php | 92 ++++++---- application/lang/class.upload.xx_XX.php | 0 .../lang/class.upload.zh_CN.gb-2312.php | 86 +++++++++ application/lang/class.upload.zh_CN.php | 0 application/lang/class.upload.zh_TW.php | 0 application/list.php | 7 +- application/md5.php | 0 application/post_del.php | 0 application/process.php | 0 application/read_log.php | 0 application/thumb.php | 0 application/total_files.php | 0 application/upload.php | 0 config/api_key.php | 0 config/config.guest.php | 0 config/config.manager.php | 0 config/config.php | 8 +- favicon.ico | Bin i/.htaccess | 0 i/index.html | 0 index.php | 0 install/README/1305032567.png | Bin install/README/2657944724.png | Bin install/README/3053540273.png | Bin install/README/674074848.png | Bin install/README/chmod.png | Bin install/README/info.png | Bin install/README/log.png | Bin install/contorl.php | 0 install/index.php | 0 install/install.php | 2 +- public/.htaccess | 0 public/images/404.png | Bin public/images/EasyImage2.0.png | Bin public/images/alipay.jpg | Bin public/images/image_icon_153794.png | Bin public/images/loading.svg | 0 public/images/watermark.png | Bin public/images/wechat.jpg | Bin public/static/EasyImage.css | 0 public/static/EasyImage.js | 0 public/static/echarts/echarts.min.js | 0 public/static/exif/exif.js | 0 public/static/fonts/FontAwesome.otf | Bin public/static/fonts/fontawesome-webfont.eot | Bin public/static/fonts/fontawesome-webfont.svg | 0 public/static/fonts/fontawesome-webfont.ttf | Bin public/static/fonts/fontawesome-webfont.woff | Bin public/static/fonts/fontawesome-webfont.woff2 | Bin public/static/hkxzy.ttf | Bin public/static/i18n/jquery.s2t.js | 0 public/static/jscolor/jscolor.min.js | 0 public/static/lazyload/lazyload.js | 0 public/static/login.css | 0 public/static/marquee/marquee.css | 0 public/static/marquee/marquee.min.js | 0 public/static/md5/md5.min.js | 0 public/static/md5/md5.min.js.map | 0 public/static/nprogress/nprogress.min.css | 0 public/static/nprogress/nprogress.min.js | 0 public/static/qrcode/qrcode.min.js | 0 public/static/tinyfilemanager/ace.js | 0 .../static/tinyfilemanager/bootstrap.min.css | 0 .../tinyfilemanager/bootstrap.min.css.map | 0 .../static/tinyfilemanager/bootstrap.min.js | 0 .../tinyfilemanager/bootstrap.min.js.map | 0 .../static/tinyfilemanager/dropzone.min.css | 0 public/static/tinyfilemanager/dropzone.min.js | 0 .../static/tinyfilemanager/ekko-lightbox.css | 0 .../tinyfilemanager/ekko-lightbox.min.js | 0 .../tinyfilemanager/ekko-lightbox.min.js.map | 0 .../tinyfilemanager/font-awesome.min.css | 0 .../static/tinyfilemanager/highlight.min.js | 0 .../static/tinyfilemanager/ir-black.min.css | 0 public/static/tinyfilemanager/ir-dark.min.css | 0 .../tinyfilemanager/jquery.dataTables.min.js | 0 .../static/tinyfilemanager/jquery.slim.min.js | 0 .../static/tinyfilemanager/translation.json | 0 public/static/tinyfilemanager/vs.min.css | 0 public/static/viewjs/viewer.min.css | 0 public/static/viewjs/viewer.min.js | 0 public/static/zui/css/zui.min.css | 6 +- public/static/zui/fonts/zenicon.eot | Bin public/static/zui/fonts/zenicon.svg | 0 public/static/zui/fonts/zenicon.ttf | Bin public/static/zui/fonts/zenicon.woff | Bin public/static/zui/js/zui.min.js | 12 +- public/static/zui/lib/bootbox/bootbox.min.css | 0 public/static/zui/lib/bootbox/bootbox.min.js | 0 .../static/zui/lib/clipboard/clipboard.min.js | 0 .../zui/lib/datagrid/zui.datagrid.min.css | 6 +- .../zui/lib/datagrid/zui.datagrid.min.js | 6 +- .../lib/datetimepicker/datetimepicker.min.css | 0 .../lib/datetimepicker/datetimepicker.min.js | 0 public/static/zui/lib/ieonly/excanvas.js | 0 public/static/zui/lib/ieonly/html5shiv.js | 0 public/static/zui/lib/ieonly/respond.js | 0 .../static/zui/lib/jquery/jquery-3.6.0.min.js | 0 public/static/zui/lib/uploader/Moxie.swf | Bin public/static/zui/lib/uploader/Moxie.xap | Bin .../zui/lib/uploader/zui.uploader.min.css | 4 +- .../zui/lib/uploader/zui.uploader.min.js | 4 +- public/static/zui/theme/zui-theme-black.css | 0 public/static/zui/theme/zui-theme-blue.css | 0 .../static/zui/theme/zui-theme-bluegrey.css | 0 public/static/zui/theme/zui-theme-brown.css | 0 public/static/zui/theme/zui-theme-default.css | 0 public/static/zui/theme/zui-theme-green.css | 0 public/static/zui/theme/zui-theme-indigo.css | 0 public/static/zui/theme/zui-theme-purple.css | 0 public/static/zui/theme/zui-theme-red.css | 0 public/static/zui/theme/zui-theme-yellow.css | 0 robots.txt | 0 144 files changed, 355 insertions(+), 134 deletions(-) mode change 100644 => 100755 README.md mode change 100644 => 100755 admin/admin.inc.php mode change 100644 => 100755 admin/chart.php mode change 100644 => 100755 admin/index.php mode change 100644 => 100755 admin/manager.php mode change 100644 => 100755 admin/terms.php mode change 100644 => 100755 admin/verson.txt mode change 100644 => 100755 admin/zui.chart.php mode change 100644 => 100755 api/index.php mode change 100644 => 100755 api/public.php mode change 100644 => 100755 application/TimThumb.php mode change 100644 => 100755 application/WaterMask.php mode change 100644 => 100755 application/captcha.php mode change 100644 => 100755 application/chart.php mode change 100644 => 100755 application/check.php mode change 100644 => 100755 application/check_admin.inc.php create mode 100755 application/class.snowflake.php mode change 100644 => 100755 application/class.thumb.php mode change 100644 => 100755 application/class.upload.php mode change 100644 => 100755 application/class.version.php mode change 100644 => 100755 application/compress/Imagick/class.Imgcompress.php mode change 100644 => 100755 application/compress/TinyImg/TinyImg.php mode change 100644 => 100755 application/compress/TinyImg/cacert.pem mode change 100644 => 100755 application/compress/function.compress.php mode change 100644 => 100755 application/compressing.php mode change 100644 => 100755 application/del.php mode change 100644 => 100755 application/down.php mode change 100644 => 100755 application/footer.php mode change 100644 => 100755 application/function.php mode change 100644 => 100755 application/header.php mode change 100644 => 100755 application/hide.php mode change 100644 => 100755 application/info.php mode change 100644 => 100755 application/lang/class.upload.xx_XX.php create mode 100755 application/lang/class.upload.zh_CN.gb-2312.php mode change 100644 => 100755 application/lang/class.upload.zh_CN.php mode change 100644 => 100755 application/lang/class.upload.zh_TW.php mode change 100644 => 100755 application/list.php mode change 100644 => 100755 application/md5.php mode change 100644 => 100755 application/post_del.php mode change 100644 => 100755 application/process.php mode change 100644 => 100755 application/read_log.php mode change 100644 => 100755 application/thumb.php mode change 100644 => 100755 application/total_files.php mode change 100644 => 100755 application/upload.php mode change 100644 => 100755 config/api_key.php mode change 100644 => 100755 config/config.guest.php mode change 100644 => 100755 config/config.manager.php mode change 100644 => 100755 config/config.php mode change 100644 => 100755 favicon.ico mode change 100644 => 100755 i/.htaccess mode change 100644 => 100755 i/index.html mode change 100644 => 100755 index.php mode change 100644 => 100755 install/README/1305032567.png mode change 100644 => 100755 install/README/2657944724.png mode change 100644 => 100755 install/README/3053540273.png mode change 100644 => 100755 install/README/674074848.png mode change 100644 => 100755 install/README/chmod.png mode change 100644 => 100755 install/README/info.png mode change 100644 => 100755 install/README/log.png mode change 100644 => 100755 install/contorl.php mode change 100644 => 100755 install/index.php mode change 100644 => 100755 install/install.php mode change 100644 => 100755 public/.htaccess mode change 100644 => 100755 public/images/404.png mode change 100644 => 100755 public/images/EasyImage2.0.png mode change 100644 => 100755 public/images/alipay.jpg mode change 100644 => 100755 public/images/image_icon_153794.png mode change 100644 => 100755 public/images/loading.svg mode change 100644 => 100755 public/images/watermark.png mode change 100644 => 100755 public/images/wechat.jpg mode change 100644 => 100755 public/static/EasyImage.css mode change 100644 => 100755 public/static/EasyImage.js mode change 100644 => 100755 public/static/echarts/echarts.min.js mode change 100644 => 100755 public/static/exif/exif.js mode change 100644 => 100755 public/static/fonts/FontAwesome.otf mode change 100644 => 100755 public/static/fonts/fontawesome-webfont.eot mode change 100644 => 100755 public/static/fonts/fontawesome-webfont.svg mode change 100644 => 100755 public/static/fonts/fontawesome-webfont.ttf mode change 100644 => 100755 public/static/fonts/fontawesome-webfont.woff mode change 100644 => 100755 public/static/fonts/fontawesome-webfont.woff2 mode change 100644 => 100755 public/static/hkxzy.ttf mode change 100644 => 100755 public/static/i18n/jquery.s2t.js mode change 100644 => 100755 public/static/jscolor/jscolor.min.js mode change 100644 => 100755 public/static/lazyload/lazyload.js mode change 100644 => 100755 public/static/login.css mode change 100644 => 100755 public/static/marquee/marquee.css mode change 100644 => 100755 public/static/marquee/marquee.min.js mode change 100644 => 100755 public/static/md5/md5.min.js mode change 100644 => 100755 public/static/md5/md5.min.js.map mode change 100644 => 100755 public/static/nprogress/nprogress.min.css mode change 100644 => 100755 public/static/nprogress/nprogress.min.js mode change 100644 => 100755 public/static/qrcode/qrcode.min.js mode change 100644 => 100755 public/static/tinyfilemanager/ace.js mode change 100644 => 100755 public/static/tinyfilemanager/bootstrap.min.css mode change 100644 => 100755 public/static/tinyfilemanager/bootstrap.min.css.map mode change 100644 => 100755 public/static/tinyfilemanager/bootstrap.min.js mode change 100644 => 100755 public/static/tinyfilemanager/bootstrap.min.js.map mode change 100644 => 100755 public/static/tinyfilemanager/dropzone.min.css mode change 100644 => 100755 public/static/tinyfilemanager/dropzone.min.js mode change 100644 => 100755 public/static/tinyfilemanager/ekko-lightbox.css mode change 100644 => 100755 public/static/tinyfilemanager/ekko-lightbox.min.js mode change 100644 => 100755 public/static/tinyfilemanager/ekko-lightbox.min.js.map mode change 100644 => 100755 public/static/tinyfilemanager/font-awesome.min.css mode change 100644 => 100755 public/static/tinyfilemanager/highlight.min.js mode change 100644 => 100755 public/static/tinyfilemanager/ir-black.min.css mode change 100644 => 100755 public/static/tinyfilemanager/ir-dark.min.css mode change 100644 => 100755 public/static/tinyfilemanager/jquery.dataTables.min.js mode change 100644 => 100755 public/static/tinyfilemanager/jquery.slim.min.js mode change 100644 => 100755 public/static/tinyfilemanager/translation.json mode change 100644 => 100755 public/static/tinyfilemanager/vs.min.css mode change 100644 => 100755 public/static/viewjs/viewer.min.css mode change 100644 => 100755 public/static/viewjs/viewer.min.js mode change 100644 => 100755 public/static/zui/css/zui.min.css mode change 100644 => 100755 public/static/zui/fonts/zenicon.eot mode change 100644 => 100755 public/static/zui/fonts/zenicon.svg mode change 100644 => 100755 public/static/zui/fonts/zenicon.ttf mode change 100644 => 100755 public/static/zui/fonts/zenicon.woff mode change 100644 => 100755 public/static/zui/js/zui.min.js mode change 100644 => 100755 public/static/zui/lib/bootbox/bootbox.min.css mode change 100644 => 100755 public/static/zui/lib/bootbox/bootbox.min.js mode change 100644 => 100755 public/static/zui/lib/clipboard/clipboard.min.js mode change 100644 => 100755 public/static/zui/lib/datagrid/zui.datagrid.min.css mode change 100644 => 100755 public/static/zui/lib/datagrid/zui.datagrid.min.js mode change 100644 => 100755 public/static/zui/lib/datetimepicker/datetimepicker.min.css mode change 100644 => 100755 public/static/zui/lib/datetimepicker/datetimepicker.min.js mode change 100644 => 100755 public/static/zui/lib/ieonly/excanvas.js mode change 100644 => 100755 public/static/zui/lib/ieonly/html5shiv.js mode change 100644 => 100755 public/static/zui/lib/ieonly/respond.js mode change 100644 => 100755 public/static/zui/lib/jquery/jquery-3.6.0.min.js mode change 100644 => 100755 public/static/zui/lib/uploader/Moxie.swf mode change 100644 => 100755 public/static/zui/lib/uploader/Moxie.xap mode change 100644 => 100755 public/static/zui/lib/uploader/zui.uploader.min.css mode change 100644 => 100755 public/static/zui/lib/uploader/zui.uploader.min.js mode change 100644 => 100755 public/static/zui/theme/zui-theme-black.css mode change 100644 => 100755 public/static/zui/theme/zui-theme-blue.css mode change 100644 => 100755 public/static/zui/theme/zui-theme-bluegrey.css mode change 100644 => 100755 public/static/zui/theme/zui-theme-brown.css mode change 100644 => 100755 public/static/zui/theme/zui-theme-default.css mode change 100644 => 100755 public/static/zui/theme/zui-theme-green.css mode change 100644 => 100755 public/static/zui/theme/zui-theme-indigo.css mode change 100644 => 100755 public/static/zui/theme/zui-theme-purple.css mode change 100644 => 100755 public/static/zui/theme/zui-theme-red.css mode change 100644 => 100755 public/static/zui/theme/zui-theme-yellow.css mode change 100644 => 100755 robots.txt diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 54271f8..573e10b --- a/README.md +++ b/README.md @@ -180,6 +180,12 @@ $HTTP["url"] =~ "^/(i|public)/" {
点击查看2.0版更新日志 +* 2022-07-09 v2.6.6 +- 增加图片信息显示随机图片 +- 增加文件雪花命名 +- 增加举报入口 +- 更新组件 + * 2022-05-27 v2.6.5 - 更改文件位置 diff --git a/admin/admin.inc.php b/admin/admin.inc.php old mode 100644 new mode 100755 index 575f1b3..34b9462 --- a/admin/admin.inc.php +++ b/admin/admin.inc.php @@ -337,7 +337,8 @@ if (isset($_GET['recycle_reimg'])) { - + + @@ -780,7 +781,7 @@ if (isset($_GET['recycle_reimg'])) { Tinyfilemanager - New + GPL-2.0

@@ -842,16 +843,21 @@ if (isset($_GET['recycle_reimg'])) { > -
- - > - -
>
+
+ + > + +
+
+ + > + +
@@ -880,7 +886,10 @@ if (isset($_GET['recycle_reimg'])) {
- + + +
+
diff --git a/admin/chart.php b/admin/chart.php old mode 100644 new mode 100755 diff --git a/admin/index.php b/admin/index.php old mode 100644 new mode 100755 diff --git a/admin/manager.php b/admin/manager.php old mode 100644 new mode 100755 diff --git a/admin/terms.php b/admin/terms.php old mode 100644 new mode 100755 diff --git a/admin/verson.txt b/admin/verson.txt old mode 100644 new mode 100755 index 6816713..952f449 --- a/admin/verson.txt +++ b/admin/verson.txt @@ -1 +1 @@ -2.6.5 \ No newline at end of file +2.6.6 \ No newline at end of file diff --git a/admin/zui.chart.php b/admin/zui.chart.php old mode 100644 new mode 100755 diff --git a/api/index.php b/api/index.php old mode 100644 new mode 100755 diff --git a/api/public.php b/api/public.php old mode 100644 new mode 100755 diff --git a/application/TimThumb.php b/application/TimThumb.php old mode 100644 new mode 100755 diff --git a/application/WaterMask.php b/application/WaterMask.php old mode 100644 new mode 100755 diff --git a/application/captcha.php b/application/captcha.php old mode 100644 new mode 100755 diff --git a/application/chart.php b/application/chart.php old mode 100644 new mode 100755 diff --git a/application/check.php b/application/check.php old mode 100644 new mode 100755 diff --git a/application/check_admin.inc.php b/application/check_admin.inc.php old mode 100644 new mode 100755 diff --git a/application/class.snowflake.php b/application/class.snowflake.php new file mode 100755 index 0000000..2eb7093 --- /dev/null +++ b/application/class.snowflake.php @@ -0,0 +1,45 @@ + + * 默认情况下41bit的时间戳可以支持该算法使用到2082年,10bit的工作机器id可以支持1023台机器,序列号支持1毫秒产生4095个自增序列id + * @author zhangqi + * @link https://www.cnblogs.com/njccqx/p/13402169.html + */ +class SnowFlake +{ + const EPOCH = 1479533469598; //开始时间,固定一个小于当前时间的毫秒数 + const max12bit = 4095; + const max41bit = 1099511627775; + + static $machineId = 1; // 机器id + + public static function machineId($mId = 0) + { + self::$machineId = $mId; + } + + public static function createOnlyId() + { + // 时间戳 42字节 + $time = floor(microtime(true) * 1000); + // 当前时间 与 开始时间 差值 + $time -= self::EPOCH; + // 二进制的 毫秒级时间戳 + $base = decbin(self::max41bit + $time); + // 机器id 10 字节 + if (!self::$machineId) { + $machineid = self::$machineId; + } else { + $machineid = str_pad(decbin(self::$machineId), 10, "0", STR_PAD_LEFT); + } + // 序列数 12字节 + $random = str_pad(decbin(mt_rand(0, self::max12bit)), 12, "0", STR_PAD_LEFT); + // 拼接 + $base = $base . $machineid . $random; + // 转化为 十进制 返回 + return bindec($base); + } +} +// SnowFlake::machineId("1"); //机器编号 +// echo SnowFlake::createOnlyId();//分布式id diff --git a/application/class.thumb.php b/application/class.thumb.php old mode 100644 new mode 100755 diff --git a/application/class.upload.php b/application/class.upload.php old mode 100644 new mode 100755 index 5552b0d..fd58ea3 --- a/application/class.upload.php +++ b/application/class.upload.php @@ -405,12 +405,28 @@ class Upload { /** * Set this variable to false if you don't want to turn dangerous scripts into simple text files + * The list of blacklisted extensions is in {@link dangerous} + * + * Note that this check happens before checking for forbidden MIME types or extensions + * If you want to forbid uploads rather than turning scripts into text files, + * set {@link no_script} to false and use {@link forbidden} instead * * @access public * @var boolean */ var $no_script; + /** + * Dangerous file extensions + * + * List of dangerous extensions, that are enforced if {@link no_script} is true + * If the file has such extension, then it is turned into a text file + * + * @access public + * @var array + */ + var $dangerous; + /** * Set this variable to true to allow automatic renaming of the file * if the file already exists @@ -1662,12 +1678,12 @@ class Upload { var $mime_types; /** - * Allowed MIME types + * Allowed MIME types or file extensions * * Default is a selection of safe mime-types, but you might want to change it * - * Simple wildcards are allowed, such as image/* or application/* - * If there is only one MIME type allowed, then it can be a string instead of an array + * Simple wildcards are allowed for MIME types, such as image/* or application/* + * If there is only one MIME type allowed or file extension, then it can be a string instead of an array * * @access public * @var array OR string @@ -1675,30 +1691,23 @@ class Upload { var $allowed; /** - * Forbidden MIME types + * Forbidden MIME types or file extensions * - * Default is a selection of safe mime-types, but you might want to change it + * Default is a selection of forbidden file extensions, but you might want to change it * To only check for forbidden MIME types, and allow everything else, set {@link allowed} to array('* / *') without the spaces * - * Simple wildcards are allowed, such as image/* or application/* - * If there is only one MIME type forbidden, then it can be a string instead of an array + * Note that if {@link no_script} is activated, dangerous scripts with extensions in {@link dangerous} + * will be set to have a .txt extension prior to checking for forbidden extensions + * If you want to forbid uploads rather than turning scripts into text files, set {@link no_script} to false + * + * Simple wildcards are allowed for MIME types, such as image/* or application/* + * If there is only one MIME type or file extension forbidden, then it can be a string instead of an array * * @access public * @var array OR string */ var $forbidden; - /** - * Blacklisted file extensions - * - * List of blacklisted extensions, that are enforced if {@link no_script} is true - * - * @access public - * @var array - */ - var $blacklist; - - /** * Array of translated error messages * @@ -1853,7 +1862,35 @@ class Upload { $this->image_frame_colors = '#FFFFFF #999999 #666666 #000000'; $this->image_frame_opacity = 100; - $this->forbidden = array(); + $this->dangerous = array( + 'php', + 'php7', + 'php6', + 'php5', + 'php4', + 'php3', + 'phtml', + 'pht', + 'phpt', + 'phtm', + 'phps', + 'inc', + 'pl', + 'py', + 'cgi', + 'asp', + 'js', + 'sh', + 'bat', + 'phar', + 'wsdl', + ); + + $this->forbidden = array_merge($this->dangerous, array( + 'exe', + 'dll', + )); + $this->allowed = array( 'application/arj', 'application/excel', @@ -2036,27 +2073,6 @@ class Upload { 'csv' => 'text/csv', ); - $this->blacklist = array( - 'php', - 'php7', - 'php6', - 'php5', - 'php4', - 'php3', - 'phtml', - 'pht', - 'phpt', - 'phtm', - 'phps', - 'inc', - 'pl', - 'py', - 'cgi', - 'asp', - 'js', - 'sh', - 'phar', - ); } @@ -2093,7 +2109,7 @@ class Upload { */ function upload($file, $lang = 'en_GB') { - $this->version = '05/10/2021'; + $this->version = '13/06/2022'; $this->file_src_name = ''; $this->file_src_name_body = ''; @@ -2429,7 +2445,7 @@ class Upload { // checks MIME type with Fileinfo PECL extension if (!$this->file_src_mime || !is_string($this->file_src_mime) || empty($this->file_src_mime) || strpos($this->file_src_mime, '/') === false) { if ($this->mime_fileinfo) { - $this->log .= '- Checking MIME type with Fileinfo PECL extension
'; + $this->log .= '- checking MIME type with Fileinfo PECL extension
'; if ($this->function_enabled('finfo_open')) { $path = null; if ($this->mime_fileinfo !== '') { @@ -2493,7 +2509,7 @@ class Upload { // checks MIME type with shell if unix access is authorized if (!$this->file_src_mime || !is_string($this->file_src_mime) || empty($this->file_src_mime) || strpos($this->file_src_mime, '/') === false) { if ($this->mime_file) { - $this->log .= '- Checking MIME type with UNIX file() command
'; + $this->log .= '- checking MIME type with UNIX file() command
'; if (substr(PHP_OS, 0, 3) != 'WIN') { if ($this->function_enabled('exec') && $this->function_enabled('escapeshellarg')) { if (strlen($mime = @exec("file -bi ".escapeshellarg($this->file_src_pathname))) != 0) { @@ -2522,7 +2538,7 @@ class Upload { // checks MIME type with mime_magic if (!$this->file_src_mime || !is_string($this->file_src_mime) || empty($this->file_src_mime) || strpos($this->file_src_mime, '/') === false) { if ($this->mime_magic) { - $this->log .= '- Checking MIME type with mime.magic file (mime_content_type())
'; + $this->log .= '- checking MIME type with mime.magic file (mime_content_type())
'; if ($this->function_enabled('mime_content_type')) { $this->file_src_mime = mime_content_type($this->file_src_pathname); $this->log .= '    MIME type detected as ' . $this->file_src_mime . ' by mime_content_type()
'; @@ -2543,7 +2559,7 @@ class Upload { // checks MIME type with getimagesize() if (!$this->file_src_mime || !is_string($this->file_src_mime) || empty($this->file_src_mime) || strpos($this->file_src_mime, '/') === false) { if ($this->mime_getimagesize) { - $this->log .= '- Checking MIME type with getimagesize()
'; + $this->log .= '- checking MIME type with getimagesize()
'; $info = getimagesize($this->file_src_pathname); if (is_array($info) && array_key_exists('mime', $info)) { $this->file_src_mime = trim($info['mime']); @@ -2586,7 +2602,7 @@ class Upload { // we need to work some magic if we upload via Flash if ($this->file_src_mime == 'application/octet-stream' || !$this->file_src_mime || !is_string($this->file_src_mime) || empty($this->file_src_mime) || strpos($this->file_src_mime, '/') === false) { if ($this->file_src_mime == 'application/octet-stream') $this->log .= '- Flash may be rewriting MIME as application/octet-stream
'; - $this->log .= '- Try to guess MIME type from file extension (' . $this->file_src_name_ext . '): '; + $this->log .= '- try to guess MIME type from file extension (' . $this->file_src_name_ext . '): '; if (array_key_exists($this->file_src_name_ext, $this->mime_types)) $this->file_src_mime = $this->mime_types[$this->file_src_name_ext]; if ($this->file_src_mime == 'application/octet-stream') { $this->log .= 'doesn\'t look like anything known
'; @@ -2600,9 +2616,14 @@ class Upload { } // determine whether the file is an image - if ($this->file_src_mime && is_string($this->file_src_mime) && !empty($this->file_src_mime) && array_key_exists($this->file_src_mime, $this->image_supported)) { - $this->file_is_image = true; - $this->image_src_type = $this->image_supported[$this->file_src_mime]; + if ($this->file_src_mime && is_string($this->file_src_mime) && !empty($this->file_src_mime)) { + if (array_key_exists($this->file_src_mime, $this->image_supported)) { + $this->file_is_image = true; + $this->image_src_type = $this->image_supported[$this->file_src_mime]; + $this->log .= '- file is an image, and its type is supported by GD
'; + } else if (strpos($this->file_src_mime, 'image/') !== FALSE && sizeof($this->image_supported) == 0) { + $this->log .= '- file may be an image, but its type is not supported; is GD installed ?
'; + } } // if the file is an image, we gather some useful data @@ -2629,7 +2650,7 @@ class Upload { } $this->log .= 'source variables
'; - $this->log .= '- You can use all these before calling process()
'; + $this->log .= '- you can use all these before calling process()
'; $this->log .= '    file_src_name : ' . $this->file_src_name . '
'; $this->log .= '    file_src_name_body : ' . $this->file_src_name_body . '
'; $this->log .= '    file_src_name_ext : ' . $this->file_src_name_ext . '
'; @@ -3120,7 +3141,7 @@ class Upload { } // if the file is text based, or has a dangerous extension, we rename it as .txt if ((((substr($this->file_src_mime, 0, 5) == 'text/' && $this->file_src_mime != 'text/rtf') || strpos($this->file_src_mime, 'javascript') !== false) && (substr($file_src_name, -4) != '.txt')) - || preg_match('/\.(' . implode('|', $this->blacklist) . ')$/i', $this->file_src_name) + || preg_match('/\.(' . implode('|', $this->dangerous) . ')$/i', $this->file_src_name) || $this->file_force_extension && empty($file_src_name_ext)) { $this->file_src_mime = 'text/plain'; if ($this->file_src_name_ext) $file_src_name_body = $file_src_name_body . '.' . $this->file_src_name_ext; @@ -3136,22 +3157,39 @@ class Upload { } else if ($this->mime_check && !empty($this->file_src_mime) && strpos($this->file_src_mime, '/') !== false) { list($m1, $m2) = explode('/', $this->file_src_mime); $allowed = false; - // check wether the mime type is allowed + // check wether the mime type or file extension is allowed if (!is_array($this->allowed)) $this->allowed = array($this->allowed); foreach($this->allowed as $k => $v) { - list($v1, $v2) = explode('/', $v); - if (($v1 == '*' && $v2 == '*') || ($v1 == $m1 && ($v2 == $m2 || $v2 == '*'))) { - $allowed = true; - break; + if (strpos($v, '/') == false) { + if ($v == '*' || strtolower($v) == strtolower($file_src_name_ext)) { + $allowed = true; + break; + } + } else { + list($v1, $v2) = explode('/', $v); + if (($v1 == '*' && $v2 == '*') || ($v1 == $m1 && ($v2 == $m2 || $v2 == '*'))) { + $allowed = true; + break; + } } } - // check wether the mime type is forbidden + if (!$allowed) $this->log .= '- MIME type and/or extension is not allowed !
'; + // check wether the mime type or file extension is forbidden if (!is_array($this->forbidden)) $this->forbidden = array($this->forbidden); foreach($this->forbidden as $k => $v) { - list($v1, $v2) = explode('/', $v); - if (($v1 == '*' && $v2 == '*') || ($v1 == $m1 && ($v2 == $m2 || $v2 == '*'))) { - $allowed = false; - break; + if (strpos($v, '/') == false) { + if ($v == '*' || strtolower($v) == strtolower($file_src_name_ext)) { + $allowed = false; + $this->log .= '- extension ' . $v . ' is forbidden !
'; + break; + } + } else { + list($v1, $v2) = explode('/', $v); + if (($v1 == '*' && $v2 == '*') || ($v1 == $m1 && ($v2 == $m2 || $v2 == '*'))) { + $allowed = false; + $this->log .= '- MIME type ' . $v . ' is forbidden !
'; + break; + } } } if (!$allowed) { @@ -3159,6 +3197,7 @@ class Upload { $this->error = $this->translate('incorrect_file'); } else { $this->log .= '- file mime OK : ' . $this->file_src_mime . '
'; + $this->log .= '- file extension OK : ' . $file_src_name_ext . '
'; } } else { $this->log .= '- file mime (not checked) : ' . $this->file_src_mime . '
'; @@ -4504,10 +4543,9 @@ class Upload { $this->log .= 'error
'; $this->image_text_font = 5; } - } // if the font is a string with a TTF font path, we check if we can access the font file - if (!is_numeric($this->image_text_font) && strlen($this->image_text_font) > 4 && substr(strtolower($this->image_text_font), -4) == '.ttf') { + } else if (!is_numeric($this->image_text_font) && strlen($this->image_text_font) > 4 && substr(strtolower($this->image_text_font), -4) == '.ttf') { $this->log .= '    try to load font ' . $this->image_text_font . '... '; if (strpos($this->image_text_font, '/') === false) $this->image_text_font = "./" . $this->image_text_font; if (file_exists($this->image_text_font) && is_readable($this->image_text_font)) { diff --git a/application/class.version.php b/application/class.version.php old mode 100644 new mode 100755 diff --git a/application/compress/Imagick/class.Imgcompress.php b/application/compress/Imagick/class.Imgcompress.php old mode 100644 new mode 100755 diff --git a/application/compress/TinyImg/TinyImg.php b/application/compress/TinyImg/TinyImg.php old mode 100644 new mode 100755 diff --git a/application/compress/TinyImg/cacert.pem b/application/compress/TinyImg/cacert.pem old mode 100644 new mode 100755 diff --git a/application/compress/function.compress.php b/application/compress/function.compress.php old mode 100644 new mode 100755 diff --git a/application/compressing.php b/application/compressing.php old mode 100644 new mode 100755 diff --git a/application/del.php b/application/del.php old mode 100644 new mode 100755 diff --git a/application/down.php b/application/down.php old mode 100644 new mode 100755 diff --git a/application/footer.php b/application/footer.php old mode 100644 new mode 100755 index f7d5809..db3398f --- a/application/footer.php +++ b/application/footer.php @@ -42,13 +42,11 @@ if ($config['notice_status'] == 1 && !empty($config['notice'])) : ?>

- © 2018- - EasyImage - By - Icret - DMCA + © 2018- + EasyImage + DMCA - +

@@ -70,6 +71,9 @@ if ($config['ad_top']) echo $config['ad_top_info']; 查看 下载 + + 举报 + 回收 删除 @@ -78,9 +82,8 @@ if ($config['ad_top']) echo $config['ad_top_info']; -

此图片来自网友上传, 不代表本站立场, 若有侵权, 请联系管理员删除!

+

此图片来自网友上传, 不代表本站立场, 若有侵权, 请举报或联系管理员!

-
-
-
-
- 直 链          - - -
-
-
-
- 论坛代码    - - -
+
+
+
+ 直 链          + +
-
-
-
- MarkDown - - -
-
-
-
- HTML         - - -
+
+
+ 论坛代码    + +
+
+
+
+ MarkDown + + +
+
+
+
+ HTML         + + +
+
+
+ + + + +
+

当月随机图片:

+ '; + } + } else { + echo '
本月还没有上传的图片哟~~
快来上传第一张吧~!
'; + } + ?> +
+
+ diff --git a/application/lang/class.upload.xx_XX.php b/application/lang/class.upload.xx_XX.php old mode 100644 new mode 100755 diff --git a/application/lang/class.upload.zh_CN.gb-2312.php b/application/lang/class.upload.zh_CN.gb-2312.php new file mode 100755 index 0000000..4cb4b11 --- /dev/null +++ b/application/lang/class.upload.zh_CN.gb-2312.php @@ -0,0 +1,86 @@ + \ No newline at end of file diff --git a/application/lang/class.upload.zh_CN.php b/application/lang/class.upload.zh_CN.php old mode 100644 new mode 100755 diff --git a/application/lang/class.upload.zh_TW.php b/application/lang/class.upload.zh_TW.php old mode 100644 new mode 100755 diff --git a/application/list.php b/application/list.php old mode 100644 new mode 100755 index 3bc44ad..644d34a --- a/application/list.php +++ b/application/list.php @@ -61,13 +61,16 @@ if ($config['ad_top']) echo $config['ad_top_info']; $linkUrl = rand_imgurl() . $config_path . $value; // 图片复制与原图地址 ?>
-
+
  • 简单图床-EasyImage
  • - + + + + diff --git a/application/md5.php b/application/md5.php old mode 100644 new mode 100755 diff --git a/application/post_del.php b/application/post_del.php old mode 100644 new mode 100755 diff --git a/application/process.php b/application/process.php old mode 100644 new mode 100755 diff --git a/application/read_log.php b/application/read_log.php old mode 100644 new mode 100755 diff --git a/application/thumb.php b/application/thumb.php old mode 100644 new mode 100755 diff --git a/application/total_files.php b/application/total_files.php old mode 100644 new mode 100755 diff --git a/application/upload.php b/application/upload.php old mode 100644 new mode 100755 diff --git a/config/api_key.php b/config/api_key.php old mode 100644 new mode 100755 diff --git a/config/config.guest.php b/config/config.guest.php old mode 100644 new mode 100755 diff --git a/config/config.manager.php b/config/config.manager.php old mode 100644 new mode 100755 diff --git a/config/config.php b/config/config.php old mode 100644 new mode 100755 index f79a33b..a4c7a9d --- a/config/config.php +++ b/config/config.php @@ -14,9 +14,9 @@ $config=Array 'imgurl'=>'http://127.0.0.1', 'user'=>'admin', 'password'=>'e6e061838856bf47e1de730719fb2609', - 'captcha'=>1, + 'captcha'=>0, 'mustLogin'=>0, - 'apiStatus'=>0, + 'apiStatus'=>1, 'path'=>'/i/', 'mime'=>'image/*,video/*', 'imgName'=>'default', @@ -64,6 +64,7 @@ $config=Array 'dark-mode'=>1, 'show_user_hash_del'=>1, 'show_exif_info'=>1, + 'info_rand_pic'=>1, 'chart_on'=>1, 'check_ip'=>0, 'check_ip_model'=>0, @@ -84,6 +85,7 @@ $config=Array ), 'language'=>0, 'login_bg'=>'https://img.paulzzh.com/touhou/random', + 'report'=>'', 'image_recycl'=>1, 'tinyfilemanager'=>1, 'delDir'=>'thumbnails/', @@ -94,7 +96,7 @@ $config=Array 'guest_path_status'=>0, 'token_path_status'=>0, 'admin_path'=>'u', - 'update'=>'2022-05-27 00:06:41', + 'update'=>'2022-07-09 18:39:54', 'footer'=>'请勿上传违反中国政策的图片