diff --git a/app/Http/Controllers/Home/Comment.php b/app/Http/Controllers/Home/Comment.php index a2baa7d..dbd1c9d 100644 --- a/app/Http/Controllers/Home/Comment.php +++ b/app/Http/Controllers/Home/Comment.php @@ -9,7 +9,7 @@ class Comment { public function add (Request $r) { if (!isset($r->submit)) return ''; if ($r->isvideo == 'f') $id = DB::table('blg_content')->select('id')->where('slug', $r->slug)->first()->id; - $banned = DB::table('blg_blacklist')->get(); + $banned = DB::table('blg_blacklist')->where('isShadow', 0)->get(); foreach ($banned as $b) { $ip = explode('.', getIp()); $ban = explode('.', $b->ipaddress); @@ -19,8 +19,9 @@ class Comment { ($ban[0] == $ip[0] && $ban[1] == $ip[1] && $ban[2] == '*' && $ban[3] == '*') ) return redirect('/bot-trap/'); } - $shadow = DB::table('blg_blacklist')->where('ipaddress', getIp())->first(); - if ($shadow && !$shadow->isShadow) return array('status' => '0101FF', 'message' => '失礼しますが、あなたはBANされていましたので、コメントを保存できません。'); + + if ($r->user_id == 0 && (str_contains($r->newmessage, 'http://') || str_contains($r->newmessage, 'https://'))) return redirect('/'); + $shadow = DB::table('blg_blacklist')->where('isShadow', 1)->where('ipaddress', getIp())->first(); $add = DB::table('blg_comments')->insertGetId([ 'user_id' => ($r->user_id != 0 ?: null), diff --git a/app/Http/Controllers/Home/CommentList.php b/app/Http/Controllers/Home/CommentList.php index 688562f..2160dc3 100644 --- a/app/Http/Controllers/Home/CommentList.php +++ b/app/Http/Controllers/Home/CommentList.php @@ -37,7 +37,7 @@ class CommentList extends Engine { $g->showcol = $det['showcol']; $g->avatar = $det['avatar']; } - + if ($g->isShadow == 0) { if (getIp() != $g->ipaddress) unset($get->comments[$k]); } @@ -49,7 +49,7 @@ class CommentList extends Engine { if (!empty($g->display_name)) $g->showname = $g->display_name; else $g->showname = $g->username; - + if (!empty($g->name_style)) $g->showcol = $g->name_style; else { foreach (getGroupColours() as $j) { @@ -60,7 +60,7 @@ class CommentList extends Engine { } } } - + $g->user = userDetail(null, DB::table('users')->select('kero_token')->where('id', $g->user_id)->first()->kero_token); } else { diff --git a/app/Http/Controllers/Home/Content.php b/app/Http/Controllers/Home/Content.php index f726557..073fca8 100644 --- a/app/Http/Controllers/Home/Content.php +++ b/app/Http/Controllers/Home/Content.php @@ -58,7 +58,7 @@ class Content extends Engine { if (count($incomplete) > 0) $err = implode('、', $incomplete).'をご入力下さい。'; // スラッグが既に存在したら、エラーを出て - if (empty($err)) { + if (empty($err)) { $sl = DB::table('blg_content')->select('slug')->where('slug', $r->slug)->first(); if ($sl && $sl->slug == $r->slug) $err = 'このスラッグがもう存在しています。'; }