Skip to content

Commit

Permalink
Merge pull request #12 from guillaumebriday/fix/xss-vuejs
Browse files Browse the repository at this point in the history
Fix/xss vuejs
  • Loading branch information
guillaumebriday authored Feb 26, 2018
2 parents cca7d65 + 8fadb39 commit 6d26151
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 23 deletions.
20 changes: 9 additions & 11 deletions resources/views/admin/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,17 @@
<link href="{{ mix('/css/admin.css') }}" rel="stylesheet">
</head>
<body class="admin-body bg-dark">
<div id="app">
@include('admin/shared/navbar')
@include('admin/shared/navbar')

<div class="content-wrapper bg-light">
<div class="container-fluid">
<div class="row">
<div class="col">
@include('shared/alerts')
<div class="content-wrapper bg-light">
<div class="container-fluid">
<div class="row">
<div class="col">
@include('shared/alerts')

<div class="card">
<div class="card-body">
@yield('content')
</div>
<div class="card">
<div class="card-body">
@yield('content')
</div>
</div>
</div>
Expand Down
7 changes: 4 additions & 3 deletions resources/views/posts/_show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
@endif

<div class="card-body">
<h4 class="card-title">{{ link_to_route('posts.show', $post->title, $post) }}</h4>
<h4 v-pre class="card-title">{{ link_to_route('posts.show', $post->title, $post) }}</h4>

<p class="card-text"><small v-pre class="text-muted">{{ link_to_route('users.show', $post->author->fullname, $post->author) }}</small></p>
<div v-pre class="card-text post-content">{!! $post->content !!}</div>

<p class="card-text"><small class="text-muted">{{ link_to_route('users.show', $post->author->fullname, $post->author) }}</small></p>
<div class="card-text post-content">{!! $post->content !!}</div>
<p class="card-text">
<small class="text-muted">{{ humanize_date($post->posted_at) }}</small><br>
<small class="text-muted">
Expand Down
6 changes: 3 additions & 3 deletions resources/views/posts/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
{{ Html::image($post->thumbnail()->url, $post->thumbnail()->original_filename, ['class' => 'img-fluid rounded']) }}
@endif

<h1>{{ $post->title }}</h1>
<h1 v-pre>{{ $post->title }}</h1>

<div class="mb-3">
<small class="text-muted">{{ link_to_route('users.show', $post->author->fullname, $post->author) }}</small>,
<small v-pre class="text-muted">{{ link_to_route('users.show', $post->author->fullname, $post->author) }}</small>,
<small class="text-muted">{{ humanize_date($post->posted_at) }}</small>
</div>

<div class="post-content">
<div v-pre class="post-content">
{!! $post->content !!}
</div>

Expand Down
2 changes: 1 addition & 1 deletion resources/views/shared/navbar.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<li class="nav-item">{{ link_to_route('register', __('auth.register'), [], ['class' => 'nav-link']) }}</li>
@else
<li class="nav-item dropdown">
<a href="#" class="nav-link dropdown-toggle" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<a v-pre href="#" class="nav-link dropdown-toggle" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ Auth::user()->name }}
</a>

Expand Down
4 changes: 2 additions & 2 deletions resources/views/users/_comment.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<div class="card mb-2">
<div class="card-body">
<div class="card-title">
@lang('comments.posted_on') <a href="{{ route('posts.show', $comment->post) }}">{{ $comment->post->title }}</a>
@lang('comments.posted_on') <a v-pre href="{{ route('posts.show', $comment->post) }}">{{ $comment->post->title }}</a>
</div>

<p class="card-text">{{ $comment->content }}</p>
<p v-pre class="card-text">{{ $comment->content }}</p>
<p class="card-text">
<small class="text-muted">{{ humanize_date($comment->posted_at) }}</small>
</p>
Expand Down
4 changes: 2 additions & 2 deletions resources/views/users/_post.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<div class="card mb-2">
<div class="card-body">
<h4 class="card-title">
<h4 v-pre class="card-title">
{{ link_to_route('posts.show', $post->title, $post) }}
</h4>

<div class="card-text post-content">{!! $post->content !!}</div>
<div v-pre class="card-text post-content">{!! $post->content !!}</div>
<p class="card-text">
<small class="text-muted">{{ humanize_date($post->posted_at) }}</small><br>
<small class="text-muted">
Expand Down
2 changes: 1 addition & 1 deletion resources/views/users/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="col-md-12">
<div class="card mb-2">
<div class="card-body text-center">
<h2 class="card-title mb-0">{{ $user->name }}</h2>
<h2 v-pre class="card-title mb-0">{{ $user->name }}</h2>
<small class="card-subtitle mb-2 text-muted">{{ $user->email }}</small>

<div class="card-text row mt-3">
Expand Down

0 comments on commit 6d26151

Please sign in to comment.