This commit is contained in:
=
2022-02-27 07:59:03 +01:00
parent 4bb8f75cc7
commit 4ee5cfb70e
9 changed files with 174 additions and 63 deletions

View File

@@ -28,7 +28,8 @@ if ($config['password'] === 'e6e061838856bf47e1de730719fb2609') {
echo '
<script>
new $.zui.Messager("请修改默认密码,否则会有泄露风险! ",{
type: "warning" // 定义颜色主题
type: "warning", // 定义颜色主题
time:7000
}).show();
</script>
';
@@ -77,3 +78,15 @@ if ($configp['checkImg'] !== 0) {
}
}
}
// 检测是否存在.user.ini
if (file_exists(APP_ROOT . '/.user.ini')) {
echo '
<script>
new $.zui.Messager("请关闭防跨目录读写或删除.user.ini文件 ",{
type: "danger", // 定义颜色主题
time:10000
}).show();
</script>
';
}

View File

@@ -39,7 +39,24 @@ if (empty($_REQUEST)) {
if (isset($_GET['hash'])) {
$delHash = $_GET['hash'];
$delHash = urlHash($delHash, 1);
getDel($delHash, 'hash');
// getDel($delHash, 'hash');
if ($config['image_recycl']) {
// 如果开启回收站则进入回收站
checkImg($delHash, 3, 'recycle/');
echo '
<script>
new $.zui.Messager("删除成功", {
type: "success", // 定义颜色主题
icon: "ok-sign" // 定义消息图标
}).show();
</script>
';
} else {
// 否则直接删除
getDel($delHash, 'url');
}
}
// 检查登录后再处理url删除请求

View File

@@ -39,6 +39,9 @@ if ($config['ad_bot']) echo $config['ad_bot_info']; // 底部广告
?>
</p>
</footer>
<link href="<?php static_cdn(); ?>/public/static/nprogress/nprogress.min.css" rel="stylesheet">
<script src="<?php static_cdn(); ?>/public/static/nprogress/nprogress.min.js"></script>
<script src="<?php static_cdn(); ?>/public/static/qrcode/qrcode.min.js"></script>
<script>
// NProgress
NProgress.start();

View File

@@ -658,7 +658,7 @@ function nsfwjs_json($url, $data = '')
* 检查图片是否违规
* @param $imageUrl string 图片url
*/
function checkImg($imageUrl, $type = 1)
function checkImg($imageUrl, $type = 1, $dir = 'suspic/')
{
global $config;
@@ -723,14 +723,15 @@ function checkImg($imageUrl, $type = 1)
// 移入回收站
if ($type == 3) {
$bad_pic = true;
$dir = 'recycle/';
}
/** # 如果违规则移动图片到违规文件夹 */
if ($bad_pic == true) {
$old_path = APP_ROOT . str_replace($config['imgurl'], '', $imageUrl); // 提交网址中的文件路径 /i/2021/10/29/p8vypd.png
$name = date('Y_m_d') . '_' . basename($imageUrl); // 文件名 2021_10_30_p8vypd.png
$new_path = APP_ROOT . $config['path'] . 'suspic/' . $name; // 新路径含文件名
$suspic_dir = APP_ROOT . $config['path'] . 'suspic/'; // suspic路径
$new_path = APP_ROOT . $config['path'] . $dir . $name; // 新路径含文件名
$suspic_dir = APP_ROOT . $config['path'] . $dir; // suspic路径
if (!is_dir($suspic_dir)) { // 创建suspic目录并移动
mkdir($suspic_dir, 0777, true);
@@ -743,15 +744,15 @@ function checkImg($imageUrl, $type = 1)
* 还原被审查的图片
* @param $name string 要还原的图片
*/
function re_checkImg($name)
function re_checkImg($name, $dir = 'suspic/')
{
global $config;
$fileToPath = str_replace('_', '/', $name); // 将图片名称还原为带路径的名称eg:2021_11_03_pbmn1a.jpg =>2021/11/03/pbmn1a.jpg
$now_path_file = APP_ROOT . $config['path'] . 'suspic/' . $name; // 当前图片绝对位置 */i/suspic/2021_10_30_p8vypd.png
$fileToPath = str_replace('_', '/', $name); // 将图片名称还原为带路径的名称eg:2021_11_03_pbmn1a.jpg =>2021/11/03/pbmn1a.jpg
$now_path_file = APP_ROOT . $config['path'] . $dir . $name; // 当前图片绝对位置 */i/suspic/2021_10_30_p8vypd.png
if (is_file($now_path_file)) {
$to_file = APP_ROOT . $config['path'] . $fileToPath; // 要还原图片的绝对位置 */i/2021/10/30/p8vypd.png
rename($now_path_file, $to_file); // 移动文件
$to_file = APP_ROOT . $config['path'] . $fileToPath; // 要还原图片的绝对位置 */i/2021/10/30/p8vypd.png
rename($now_path_file, $to_file); // 移动文件
return true;
}
}

View File

@@ -13,17 +13,11 @@
<meta name="keywords" content="<?php echo $config['keywords']; ?>" />
<meta name="description" content="<?php echo $config['description']; ?>" />
<link rel="shortcut icon" href="<?php echo $config['domain']; ?>/favicon.ico" type="image/x-icon" />
<link rel="dns-prefetch" href="<?php echo $config['imgurl']; ?>" />
<link rel="dns-prefetch" href="<?php echo $config['static_cdn_url']; ?>" />
<link href="<?php static_cdn(); ?>/public/static/zui/css/zui.min.css" rel="stylesheet">
<link href="<?php static_cdn(); ?>/public/static/zui/theme/zui-theme-<?php echo $config['theme']; ?>.css" rel="stylesheet">
<link href="<?php static_cdn(); ?>/public/static/zui/lib/uploader/zui.uploader.min.css" rel="stylesheet">
<link href="<?php static_cdn(); ?>/public/static/nprogress/nprogress.min.css" rel="stylesheet">
<script src="<?php static_cdn(); ?>/public/static/zui/lib/jquery/jquery-3.6.0.min.js"></script>
<script src="<?php static_cdn(); ?>/public/static/zui/js/zui.min.js"></script>
<script src="<?php static_cdn(); ?>/public/static/qrcode/qrcode.min.js"></script>
<script src="<?php static_cdn(); ?>/public/static/zui/lib/clipboard/clipboard.min.js"></script>
<script src="<?php static_cdn(); ?>/public/static/nprogress/nprogress.min.js"></script>
<script src="<?php static_cdn(); ?>/public/static/zui/js/zui.min.js"></script>
<!--[if lt IE 9]>
<script src="<?php static_cdn(); ?>/public/static/zui/lib/ieonly/html5shiv.js"></script>
<script src="<?php static_cdn(); ?>/public/static/zui/lib/ieonly/respond.js"></script>