diff --git a/app/Http/Controllers/CommentController.php b/app/Http/Controllers/CommentController.php index 1ec7bbf4d..8b8eded8e 100644 --- a/app/Http/Controllers/CommentController.php +++ b/app/Http/Controllers/CommentController.php @@ -34,8 +34,8 @@ class CommentController extends Controller $reply = new Status(); $reply->profile_id = $profile->id; - $reply->caption = $comment; - $reply->rendered = e($comment); + $reply->caption = e(strip_tags($comment)); + $reply->rendered = $comment; $reply->in_reply_to_id = $status->id; $reply->in_reply_to_profile_id = $status->profile_id; $reply->save(); diff --git a/app/Http/Controllers/StatusController.php b/app/Http/Controllers/StatusController.php index 1ce080245..704beea6c 100644 --- a/app/Http/Controllers/StatusController.php +++ b/app/Http/Controllers/StatusController.php @@ -47,7 +47,7 @@ class StatusController extends Controller $status = new Status; $status->profile_id = $profile->id; - $status->caption = $request->caption; + $status->caption = strip_tags($request->caption); $status->is_nsfw = $cw; $status->save(); diff --git a/resources/views/status/show.blade.php b/resources/views/status/show.blade.php index 80e7e41d3..8d2e27d67 100644 --- a/resources/views/status/show.blade.php +++ b/resources/views/status/show.blade.php @@ -16,17 +16,46 @@
- @if($status->is_nsfw) + @if($status->is_nsfw && $status->media_count == 1)

NSFW / Hidden Image - +

- @else - + @elseif(!$status->is_nsfw && $status->media_count == 1) +
+ +
+ @elseif($status->is_nsfw && $status->media_count > 1) + + @elseif(!$status->is_nsfw && $status->media_count > 1) + @endif
@@ -51,7 +80,7 @@ @foreach($status->comments->reverse()->take(10) as $item)

{{$item->profile->username}} - {!!$item->rendered!!} {{$item->created_at->diffForHumans(null, true, true ,true)}} + {!! $item->rendered ?? e($item->caption) !!} {{$item->created_at->diffForHumans(null, true, true ,true)}}

@endforeach
diff --git a/resources/views/status/template.blade.php b/resources/views/status/template.blade.php index 2e56e6ee5..7a3910887 100644 --- a/resources/views/status/template.blade.php +++ b/resources/views/status/template.blade.php @@ -15,6 +15,7 @@ Embed @if(Auth::check()) @if(Auth::user()->profile->id === $item->profile->id || Auth::user()->is_admin == true) + Edit
@csrf @@ -32,13 +33,13 @@

NSFW / Hidden Image - +

@else - + @endif @@ -84,7 +85,7 @@ {{$status->profile->username}} - {!!$status->rendered!!} + {!! $item->rendered ?? e($item->caption) !!} {{$status->created_at->diffForHumans(null, true, true, true)}} @@ -95,7 +96,7 @@ @foreach($item->comments->reverse()->take(3) as $comment)

{{$comment->profile->username}} - {{ str_limit($comment->caption, 125) }} + {!! str_limit($item->rendered ?? e($item->caption), 150) !!}

@endforeach @endif