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 %}
|
||||
@@ -13,10 +13,10 @@
|
||||
{% elseif survey %}
|
||||
<article class="survey-card">
|
||||
<div class="survey-meta">
|
||||
<h3>{{ survey.title }}</h3>
|
||||
<h3>{{ survey.title|striptags|trim }}</h3>
|
||||
{% if progress.total > 0 %}<span class="survey-badge neutral">{{ progress.current }}/{{ progress.total }}</span>{% endif %}
|
||||
</div>
|
||||
<p>{{ survey.description ?: 'Bitte beantworten Sie die folgenden Fragen. Jede Frage wird einzeln angezeigt.' }}</p>
|
||||
<p>{{ (survey.description|striptags|trim) ?: 'Bitte beantworten Sie die folgenden Fragen. Jede Frage wird einzeln angezeigt.' }}</p>
|
||||
|
||||
{% if progress.total > 0 %}
|
||||
<div class="survey-progress"><span style="width: {{ progress.percentage }}%"></span></div>
|
||||
@@ -32,8 +32,8 @@
|
||||
{% for answer in answers %}
|
||||
<article class="survey-card">
|
||||
<div class="survey-badge neutral">{{ answer.questionType }}</div>
|
||||
<h4>{{ answer.question }}</h4>
|
||||
<p>{{ answer.value }}</p>
|
||||
<h4>{{ answer.question|striptags|trim }}</h4>
|
||||
<p>{{ answer.value|striptags|trim }}</p>
|
||||
</article>
|
||||
{% endfor %}
|
||||
</div>
|
||||
@@ -42,8 +42,8 @@
|
||||
{% elseif question %}
|
||||
<article class="survey-card">
|
||||
<div class="survey-meta"><span class="survey-badge neutral">Frage {{ progress.current }}</span></div>
|
||||
<h3>{{ question.question }}</h3>
|
||||
{% if question.description %}<p>{{ question.description }}</p>{% endif %}
|
||||
<h3>{{ question.question|striptags|trim }}</h3>
|
||||
{% if question.description|striptags|trim %}<p>{{ question.description|striptags|trim }}</p>{% endif %}
|
||||
|
||||
{{ form_start(surveyForm, {attr: {class: 'survey-form-grid'}}) }}
|
||||
<input type="hidden" name="REQUEST_TOKEN" value="{{ contao.request_token }}">
|
||||
@@ -51,7 +51,7 @@
|
||||
<div class="survey-grid" style="grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));">
|
||||
{% for child in surveyForm.answer %}
|
||||
<label class="survey-card" style="cursor: pointer;">
|
||||
<div class="survey-meta"><strong>{{ child.vars.label }}</strong>{{ form_widget(child) }}</div>
|
||||
<div class="survey-meta"><strong>{{ child.vars.label|striptags|trim }}</strong>{{ form_widget(child) }}</div>
|
||||
<div>Diese Antwort wird direkt fuer den weiteren Ablauf verwendet.</div>
|
||||
</label>
|
||||
{% endfor %}
|
||||
@@ -60,7 +60,7 @@
|
||||
<div class="survey-grid" style="grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));">
|
||||
{% for child in surveyForm.answer %}
|
||||
<label class="survey-card" style="cursor: pointer;">
|
||||
<div class="survey-meta"><strong>{{ child.vars.label }}</strong>{{ form_widget(child) }}</div>
|
||||
<div class="survey-meta"><strong>{{ child.vars.label|striptags|trim }}</strong>{{ form_widget(child) }}</div>
|
||||
</label>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user