[PLUGINS][AttachmentShowRelated] Fixed note template error. Fixed if statement.

[CORE][Controller] Commented CSP out.
This commit is contained in:
Eliseu Amaro 2021-11-23 22:54:49 +00:00 committed by Diogo Peralta Cordeiro
parent 8edaabbabf
commit d8147cbd2d
No known key found for this signature in database
GPG Key ID: 18D2D35001FBFAB0
5 changed files with 16 additions and 28 deletions

View File

@ -24,16 +24,9 @@
{% endif %}
{% set current_path = app.request.get('_route') %}
{% if right_panel_vars is defined %}
{% for block in handle_event('AppendRightPanelBlock', {'path': current_path, 'vars': right_panel_vars}) %}
{{ block | raw }}
{% endfor %}
{% else %}
{% for block in handle_event('AppendRightPanelBlock', {'path': current_path}) %}
{{ block | raw }}
{% endfor %}
{% endif %}
{% for block in handle_event('AppendRightPanelBlock', {'path': current_path, 'vars': right_panel_vars | default }) %}
{{ block | raw }}
{% endfor %}
</aside>
</div>

View File

@ -1,9 +1,11 @@
{% import '/cards/note/view.html.twig' as noteView %}
<section class="section-widget section-widget-padded">
<div class="section-title">
{{ 'Notes related' | trans }}
</div>
{% for note in related_notes %}
{% include '/cards/note/view.html.twig' with {'note' : note, 'hide_attachments': true, 'have_user': have_user} only %}
{{ noteView.macro_note_minimal(note) }}
{% endfor %}
</section>

View File

@ -149,14 +149,14 @@ abstract class Controller extends AbstractController implements EventSubscriberI
if ($template !== null) {
$event->setResponse($this->render($template, $this->vars));
// Setting the Content-Security-Policy response header
$policy = "default-src 'self';"
. "script-src 'strict-dynamic' https: http:;"
. "object-src 'none'; base-uri 'none'";
$potential_response = $event->getResponse();
$potential_response->headers->set('Content-Security-Policy', $policy);
$potential_response->headers->set('X-Content-Security-Policy', $policy);
$potential_response->headers->set('X-WebKit-CSP', $policy);
/* // Setting the Content-Security-Policy response header
$policy = "default-src 'self';"
. "script-src 'strict-dynamic' https: http:;"
. "object-src 'none'; base-uri 'none'";
$potential_response = $event->getResponse();
$potential_response->headers->set('Content-Security-Policy', $policy);
$potential_response->headers->set('X-Content-Security-Policy', $policy);
$potential_response->headers->set('X-WebKit-CSP', $policy);*/
break;
} else {

View File

@ -14,10 +14,10 @@
</title>
{% block stylesheets %}
<link rel="preload" href="{{ asset('assets/default_theme/css/base.css') }}" as="style" type="text/css">
<link rel="stylesheet" href="{{ asset('assets/default_theme/css/base.css') }}">
<link rel="stylesheet" type='text/css' href="{{ asset('assets/default_theme/css/base.css') }}">
{% for stylesheet in show_stylesheets(app.request.get('_route')) %}
<link rel="preload" {{ preload(asset(stylesheet), { as: 'style', nopush: true }) }}>
<link rel='stylesheet' type='text/css' href="{{ asset(stylesheet) }}">
{% endfor %}
{% endblock %}

View File

@ -8,13 +8,6 @@
{% endif %}
{% endblock note_actions %}
{% block note_reply_to %}
{% set reply_to = note.getReplyToNickname()%}
{% if reply_to is not null %}
{% trans with {'%name%': reply_to} %} in reply to %name% {% endtrans %}
{% endif %}
{% endblock note_reply_to %}
{% block note_replies %}
{% if replies is defined and replies is not empty %}
<div class="u-in-reply-to replies" tabindex="0" title="{{ 'Begin replies to ' | trans }} {{ nickname }}'s note!">