Sanitize survey frontend and PDF output
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{% include '@Survey/frontend/_survey_assets.html.twig' %}
|
||||
{% include '@Survey/frontend/_survey_branding.html.twig' %}
|
||||
|
||||
{% set moduleHeadline = headline is iterable ? headline.text|default('') : headline|default('') %}
|
||||
{% set moduleHeadline = (headline is iterable ? headline.text|default('') : headline|default(''))|striptags|trim %}
|
||||
|
||||
<section class="survey-shell survey-grid">
|
||||
{% if moduleHeadline %}
|
||||
@@ -15,12 +15,12 @@
|
||||
{% elseif survey %}
|
||||
<article class="survey-card">
|
||||
<div class="survey-meta">
|
||||
<h2>{{ survey.title }}</h2>
|
||||
<h2>{{ survey.title|striptags|trim }}</h2>
|
||||
<span class="survey-badge neutral">{{ completedSubmissionCount }} abgeschlossene Teilnahmen</span>
|
||||
<span class="survey-badge neutral">{{ questionResults|length }} Fragen</span>
|
||||
</div>
|
||||
|
||||
<p>{{ survey.description ?: 'Keine Beschreibung hinterlegt.' }}</p>
|
||||
<p>{{ (survey.description|striptags|trim) ?: 'Keine Beschreibung hinterlegt.' }}</p>
|
||||
|
||||
{% if downloadUrl or pdfDownloadUrl %}
|
||||
<div class="survey-button-row">
|
||||
@@ -38,13 +38,13 @@
|
||||
{% for question in questionResults %}
|
||||
<article class="survey-card survey-results-card">
|
||||
<div class="survey-meta">
|
||||
<h3>{{ question.question }}</h3>
|
||||
<h3>{{ question.question|striptags|trim }}</h3>
|
||||
<span class="survey-badge neutral">{{ question.totalAnswers }} Antworten</span>
|
||||
<span class="survey-badge neutral">{{ question.responseRate }}% Ruecklauf</span>
|
||||
</div>
|
||||
|
||||
{% if question.description %}
|
||||
<p>{{ question.description }}</p>
|
||||
{% if question.description|striptags|trim %}
|
||||
<p>{{ question.description|striptags|trim }}</p>
|
||||
{% endif %}
|
||||
|
||||
<div class="survey-results-layout{% if not question.chart %} no-chart{% endif %}">
|
||||
@@ -62,7 +62,7 @@
|
||||
{% for option in question.options %}
|
||||
<div class="survey-results-row">
|
||||
<div class="survey-meta">
|
||||
<strong>{{ option.label }}</strong>
|
||||
<strong>{{ option.label|striptags|trim }}</strong>
|
||||
<span class="survey-badge neutral">{{ option.count }}</span>
|
||||
<span class="survey-badge neutral">{{ option.percentage }}%</span>
|
||||
</div>
|
||||
@@ -92,7 +92,7 @@
|
||||
{% for option in question.distribution %}
|
||||
<div class="survey-results-row">
|
||||
<div class="survey-meta">
|
||||
<strong>{{ option.label }}</strong>
|
||||
<strong>{{ option.label|striptags|trim }}</strong>
|
||||
<span class="survey-badge neutral">{{ option.count }}</span>
|
||||
<span class="survey-badge neutral">{{ option.percentage }}%</span>
|
||||
</div>
|
||||
@@ -110,7 +110,7 @@
|
||||
{% for option in question.responseSummary %}
|
||||
<div class="survey-results-row">
|
||||
<div class="survey-meta">
|
||||
<strong>{{ option.label }}</strong>
|
||||
<strong>{{ option.label|striptags|trim }}</strong>
|
||||
<span class="survey-badge neutral">{{ option.count }}</span>
|
||||
<span class="survey-badge neutral">{{ option.percentage }}%</span>
|
||||
</div>
|
||||
@@ -124,7 +124,7 @@
|
||||
|
||||
<div class="survey-results-list survey-results-responses">
|
||||
{% for response in question.responses %}
|
||||
<blockquote class="survey-card survey-response-card">{{ response|nl2br }}</blockquote>
|
||||
<blockquote class="survey-card survey-response-card">{{ response|striptags|trim|nl2br }}</blockquote>
|
||||
{% else %}
|
||||
<p>Noch keine Freitextantworten vorhanden.</p>
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user