From d4c647cb4dca543e2ff4a6f94d9cdaed87d6a515 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 15 Feb 2021 02:49:17 -0700 Subject: [PATCH] Update ReportController, add new report types --- app/Http/Controllers/ReportController.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php index 1eeb480a..aa20fb3e 100644 --- a/app/Http/Controllers/ReportController.php +++ b/app/Http/Controllers/ReportController.php @@ -23,7 +23,7 @@ class ReportController extends Controller $this->validate($request, [ 'type' => 'required|alpha_dash', 'id' => 'required|integer|min:1', - ]); + ]); return view('report.form'); } @@ -98,7 +98,19 @@ class ReportController extends Controller $object_type = $request->input('type'); $msg = $request->input('msg'); $object = null; - $types = ['spam', 'sensitive', 'abusive']; + $types = [ + // original 3 + 'spam', + 'sensitive', + 'abusive', + + // new + 'underage', + 'copyright', + 'impersonation', + 'scam', + 'terrorism' + ]; if (!in_array($reportType, $types)) { return redirect('/timeline')->with('error', 'Invalid report type'); @@ -134,7 +146,7 @@ class ReportController extends Controller $report->object_type = $object_type; $report->reported_profile_id = $object->profile_id; $report->type = $request->input('report'); - $report->message = $request->input('msg'); + $report->message = e($request->input('msg')); $report->save(); return redirect('/timeline')->with('status', 'Report successfully sent!');