diff --git a/app/Controllers/SkinlibController.php b/app/Controllers/SkinlibController.php
index d81d4576..8962df89 100644
--- a/app/Controllers/SkinlibController.php
+++ b/app/Controllers/SkinlibController.php
@@ -98,6 +98,10 @@ class SkinlibController extends BaseController
$texture = Texture::find($_GET['tid']);
if (!$texture || $texture && !\Storage::exist(BASE_DIR."/textures/".$texture->hash)) {
+ if (Option::get('auto_del_invalid_texture') == "1") {
+ if ($texture) $texture->delete();
+ Http::abort(404, '请求的材质文件已经被删除');
+ }
Http::abort(404, '请求的材质文件已经被删除,请联系管理员删除该条目');
}
diff --git a/setup/options.php b/setup/options.php
index daab4d7a..0b8fe546 100644
--- a/setup/options.php
+++ b/setup/options.php
@@ -3,7 +3,7 @@
* @Author: printempw
* @Date: 2016-07-29 11:53:11
* @Last Modified by: printempw
- * @Last Modified time: 2016-08-15 22:09:17
+ * @Last Modified time: 2016-08-17 18:06:10
*/
return [
@@ -32,5 +32,6 @@ return [
'version' => '',
'check_update' => '1',
'update_source' => 'github',
- 'copyright_text' => 'Copyright © 2016 {site_name}. All rights reserved.'
+ 'copyright_text' => 'Copyright © 2016 {site_name}. All rights reserved.',
+ 'auto_del_invalid_texture' => '1'
];