Skip to content

Commit

Permalink
fix(PC): 修复 xss 问题
Browse files Browse the repository at this point in the history
issue #583
  • Loading branch information
mutoe committed Jan 8, 2019
1 parent 194b1ef commit 588afe6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@
$content = mb_substr($post['feed_content'], 0, $config['bootstrappers']['feed']['limit'], 'utf-8');
$len = (strlen($content) + mb_strlen($content, 'utf-8')) / 2;
@endphp
{!! $content !!}
{!! formatContent($content) !!}
<span class="fuzzy">@php for ($i = 0; $i < (200 - $len); $i ++) {echo 'T';} @endphp</span>
</p>
@else
<a class="feed_text" href="{{ route('pc:feedread', ['feed' => $post['id']]) }}">
@php
$content = formatContent($post['feed_content']);
$content = $post['feed_content'];
$has_more = mb_strlen($content, 'utf-8') > 100;
$content = mb_substr($content, 0, 100, 'utf-8');
@endphp
{!! $content !!}
{!! formatContent($content) !!}
@if($has_more)
<span class="more"> ...查看更多</span>
@endif
Expand Down

0 comments on commit 588afe6

Please sign in to comment.