Fix flash info html save and display

- require kwaadpepper/crud-policies version 0.2.0
This commit is contained in:
Jérémy Munsch 2021-11-10 12:28:47 +01:00
parent 5bb79e32f2
commit 4bad915c09
No known key found for this signature in database
GPG key ID: 55196BEE445F6049
8 changed files with 52 additions and 19 deletions

View file

@ -18,7 +18,9 @@ class XssSanitizer
$inputs = $request->all();
array_walk_recursive($inputs, function (&$input, $name) use ($params) {
if (in_array($name, $params)) {
// dd($input);
$input = clean($input);
// dd($input);
} else {
$input = strip_tags($input);
}

View file

@ -12,7 +12,7 @@
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"htmlmin/htmlmin": "^8.0",
"kwaadpepper/crud-policies": "^0.1.16",
"kwaadpepper/crud-policies": "^0.2.0",
"kwaadpepper/enum": "^2.0",
"kwaadpepper/exception-handler": "^0.0.1",
"kwaadpepper/image-resizer": "^0.0.3",

14
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "cc3bd882d3df0ba824d42cd9c8da2380",
"content-hash": "aa6a451b2a130545431f84b00225801f",
"packages": [
{
"name": "asm89/stack-cors",
@ -1763,16 +1763,16 @@
},
{
"name": "kwaadpepper/crud-policies",
"version": "0.1.22",
"version": "0.2.0",
"source": {
"type": "git",
"url": "https://github.com/Kwaadpepper/crud-policies.git",
"reference": "fb3c8e2ee065f9ed102db90394838b255d06cc15"
"reference": "46a43a1f191e8dc3ddf9cc76f97d4cc3998ddbdd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Kwaadpepper/crud-policies/zipball/fb3c8e2ee065f9ed102db90394838b255d06cc15",
"reference": "fb3c8e2ee065f9ed102db90394838b255d06cc15",
"url": "https://api.github.com/repos/Kwaadpepper/crud-policies/zipball/46a43a1f191e8dc3ddf9cc76f97d4cc3998ddbdd",
"reference": "46a43a1f191e8dc3ddf9cc76f97d4cc3998ddbdd",
"shasum": ""
},
"require": {
@ -1821,9 +1821,9 @@
],
"support": {
"issues": "https://github.com/Kwaadpepper/crud-policies/issues",
"source": "https://github.com/Kwaadpepper/crud-policies/tree/0.1.22"
"source": "https://github.com/Kwaadpepper/crud-policies/tree/0.2.0"
},
"time": "2021-10-22T10:14:13+00:00"
"time": "2021-11-10T11:22:31+00:00"
},
{
"name": "kwaadpepper/enum",

View file

@ -9,6 +9,17 @@ return [
*/
'urlPrefix' => 'crud-policies',
/**
* You shall protect routes
* These are applied to crud routes directly as middlewares
*/
'middlewares' => [
\App\Http\Middleware\EncryptCookies::class,
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Session\Middleware\StartSession::class,
'auth:web'
],
/**
* The public path where are stored
* crud-policies asset files

View file

@ -25,24 +25,23 @@ return [
'cacheFileMode' => 0755,
'settings' => [
'default' => [
'HTML.SafeIframe' => true, // For iframes
'URI.SafeIframeRegexp' => "%^(http://|https://|//)(vimeo.com)%",
'HTML.Doctype' => 'HTML 4.01 Transitional',
'HTML.Allowed' => 'div,b,strong,i,em,u,a[href|title],ul,ol,li,p[style],br,span[style],img[width|height|alt|src]',
'CSS.AllowedProperties' => 'font,font-size,font-weight,font-style,font-family,text-decoration,padding-left,color,background-color,text-align',
'HTML.Allowed' => 'h1[style],h2[style],h3[style],h4[style],h5[style],h6[style],figure[class|style],oembed[url],div[style],b,strong,i,em,u,a[href|title],ul[style],ol[style],dl[style],li,p[style],br,span[style|class],img[width|height|alt|src|style|class],iframe[src|width|height|class|frameborder|style],table[style],thead,tbody,th,tr,td,hr',
'CSS.AllowedProperties' => 'font,font-size,font-weight,font-style,font-family,text-decoration,padding-left,color,background-color,text-align,list-style-type,float,width,height',
'AutoFormat.AutoParagraph' => false,
'AutoFormat.RemoveEmpty' => true,
'AutoFormat.RemoveEmpty.RemoveNbsp' => true,
],
'test' => [
'Attr.EnableID' => 'true',
'AutoFormat.RemoveEmpty' => false,
'AutoFormat.RemoveEmpty.RemoveNbsp' => false,
],
"youtube" => [
"HTML.SafeIframe" => 'true',
"URI.SafeIframeRegexp" => "%^(http://|https://|//)(www.youtube.com/embed/|player.vimeo.com/video/)%",
"URI.SafeIframeRegexp" => "%^(http://|https://|//)(www.youtube.com/embed/|player.vimeo.com/video/|vimeo.com/)%",
],
'custom_definition' => [
'id' => 'html5-definitions',
'rev' => 1,
'debug' => false,
'debug' => true,
'elements' => [
// http://developers.whatwg.org/sections.html
['section', 'Block', 'Flow', 'Common'],
@ -59,6 +58,7 @@ return [
// http://developers.whatwg.org/grouping-content.html
['figure', 'Block', 'Optional: (figcaption, Flow) | (Flow, figcaption) | Flow', 'Common'],
['figcaption', 'Inline', 'Flow', 'Common'],
['oembed', 'Inline', 'Flow', 'Common'],
// http://developers.whatwg.org/the-video-element.html#the-video-element
['video', 'Block', 'Optional: (source, Flow) | (Flow, source) | Flow', 'Common', [
@ -95,13 +95,24 @@ return [
['tr', 'width', 'Text'],
['tr', 'height', 'Text'],
['tr', 'border', 'Text'],
['figure', 'class', 'Text'],
['figure', 'style', 'Text'],
['oembed', 'url', 'Text'],
['span', 'style', 'Text'],
['img', 'style', 'Text'],
],
],
'custom_attributes' => [
['a', 'target', 'Enum#_blank,_self,_target,_top'],
['ol', 'style', 'Text'],
['figure', 'style', 'Text'],
['img', 'style', 'Text'],
['span', 'style', 'Text'],
['oembed', 'url', 'Text'],
],
'custom_elements' => [
['u', 'Inline', 'Inline', 'Common'],
['oembed', 'Inline', 'Inline', 'Common'],
],
],

View file

@ -1,3 +1,9 @@
@import "_import";
@import "layouts/backend/top_nav";
// ckeditor fix with to navbar
.ck .ck-sticky-panel .ck-sticky-panel__content_sticky {
position: fixed !important;
top: 3.6rem !important;
}

View file

@ -20,7 +20,9 @@
<h1 class="titleNormal">{{ $flash->title }}</h1>
<h1 class="date">{{ $flash->created_at->format('d/m/Y') }}</h1>
</div>
<p class="container-news__article">{!! $flash->content !!}</p>
<div class="container-news__article">
<div class="ck-content">{!! clean($flash->content) !!}</div>
</div>
<div class="btn-center">
<div class="btn-center-secondary"><a href="{{ route('fo.flash.index') }}">Retour</a> </div>
</div>
@ -35,4 +37,4 @@
</div>
@endsection
@endsection

View file

@ -3,6 +3,7 @@
<head>
@include('layouts.frontend.head')
@stack('styles')
@crudPoliciesCSS()
</head>
<body>
@include("layouts.frontend.header")