Skip to content

Commit

Permalink
v2.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
icret committed Apr 12, 2023
1 parent 9a3780a commit 55a7c2e
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 8 deletions.
2 changes: 1 addition & 1 deletion admin/chart.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
require_once APP_ROOT . '/app/chart.php';

// 检测登录和是否开启统计
if (!$config['chart_on'] && !is_who_login('admin')) exit(header('Location: ' . $config['domain'] . '?hart#closed'));
if (!$config['chart_on'] || !is_who_login('admin')) exit(header('Location: ' . $config['domain'] . '?hart#closed'));

// 删除统计文件
if (isset($_POST['del_total'])) {
Expand Down
2 changes: 1 addition & 1 deletion admin/zui.chart.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
require_once APP_ROOT . '/app/chart.php';

// 检测是否开启统计
if (!$config['chart_on']) exit(header('Location: ' . $config['domain'] . '?chart#closed'));
if (!$config['chart_on'] || !is_who_login('admin')) exit(header('Location: ' . $config['domain'] . '?hart#closed'));

// 检测登录
if (!is_who_login('admin')) {
Expand Down
4 changes: 4 additions & 0 deletions app/check.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?php

/** 禁止直接访问 */
defined('APP_ROOT') ?: exit;

// 跳转安装
if (!is_file(APP_ROOT . '/config/install.lock') and is_file(APP_ROOT . '/install/install.php')) {
exit('<script type="text/javascript">window.location.href="' . get_whole_url('/') . '/install/index.php"</script>');
Expand Down
4 changes: 4 additions & 0 deletions app/check_admin.inc.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?php

/** 禁止直接访问 */
defined('APP_ROOT') ?: exit;

/*
// 检查当前PHP版本是否大于7.0
if (PHP_VERSION < 7) {
Expand Down
1 change: 1 addition & 0 deletions app/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

/** 禁止直接访问 */
defined('APP_ROOT') ?: exit;

/** 弹窗公告 */
if ($config['notice_status'] > 0) : ?>
<div class="modal fade" id="notice">
Expand Down
2 changes: 1 addition & 1 deletion app/function.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
// 判断当前的系统类型是否为windows
define('IS_WIN', strstr(PHP_OS, 'WIN') ? 1 : 0);
// 定义当前版本
define('APP_VERSION', '2.8.0');
define('APP_VERSION', '2.8.1');

/*---------------基础配置结束-------------------*/

Expand Down
3 changes: 3 additions & 0 deletions app/total_files.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php

/** 禁止直接访问 */
defined('APP_ROOT') ?: exit;

/**
* 统计文件
*
Expand Down
7 changes: 4 additions & 3 deletions app/upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@
));
}

// sign
if (empty($_POST['sign']) || $_POST['sign'] !== date('YmdH')) {
// sign : 前端生成的时间戳 time() - $_POST['sign'] = 从选择文件到上传完毕的耗费时间
if (empty($_POST['sign']) || time() - $_POST['sign'] > 12306) {
exit(json_encode(array(
"result" => "failed",
"code" => 403,
"code" => 403,
"systime" => time(),
"message" => "上传签名错误,请刷新重试",
)));
}
Expand Down
6 changes: 6 additions & 0 deletions docs/update.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
* 2023-04-12 v2.8.1
- 修改上传签名生成方式
- 修复一处绕过代码
- 修复部分会曝露网站路径的代码
- 增加检测cookie|Local storage

* 2023-04-05 v2.8.0
- 修复定时删除最小值不能为0
- 修复上传完毕后多次点击复制失效
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
flash_swf_url: '<?php static_cdn(); ?>/public/static/zui/lib/uploader/Moxie.xap',
// sign
multipart_params: {
'sign': new Date().format("YYYYMMddhh"),
'sign': Date.now() / 1000,
},
// 预览图尺寸
previewImageSize: {
Expand Down
26 changes: 25 additions & 1 deletion public/static/EasyImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ $('#btnLinks, #btnBbscode, #btnMarkDown, #btnHtml, #btnThumb, #btnDel').on('clic

var formData = new FormData();
formData.append('file', file);
formData.append('sign', new Date().format("YYYYMMddhh"));
formData.append('sign', Date.now());
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState == 1) {
Expand Down Expand Up @@ -299,6 +299,30 @@ $('#btnLinks, #btnBbscode, #btnMarkDown, #btnHtml, #btnThumb, #btnDel').on('clic
});
})();

// 检测浏览器是否支持cookie
if (navigator.cookieEnabled === false) {
new $.zui.Messager('浏览器不支持cookie, 无法保存登录信息', {
type: 'black',
icon: 'bell',
time: 4500,
placement: 'top'
}).show();

console.log('浏览器不支持cookie');
}

// 检测浏览器是否支持本地存储
if ($.zui.store.enable === false) {
new $.zui.Messager('浏览器不支持本地存储, 无法保存上传历史记录', {
icon: 'bell',
time: 4000,
type: 'primary',
placement: 'top'
}).show();

console.log('浏览器不支持本地存储');
}

/**
* javascript parseUrl函数解析url获取网址url参数
* https://www.cnblogs.com/lazb/p/10144471.html
Expand Down

0 comments on commit 55a7c2e

Please sign in to comment.