Skip to content

Commit ce56951

Browse files
committed
Add remove_xss function in twig
1 parent 39fc564 commit ce56951

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

main/inc/lib/template.lib.php

+4
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ public function __construct(
181181
'name' => 'date_to_time_ago',
182182
'callable' => 'Display::dateToStringAgoAndLongDate',
183183
],
184+
[
185+
'name' => 'remove_xss',
186+
'callable' => 'Security::remove_XSS',
187+
],
184188
];
185189

186190
foreach ($filters as $filter) {

main/template/default/social/user_block.tpl

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@
102102
{% set linkedin_url = '' %}
103103
{% for extra in user.extra %}
104104
{% if extra.value.getField().getVariable() == 'skype' %}
105-
{% set skype_account = extra.value.getValue() | escape %}
105+
{% set skype_account = extra.value.getValue() | remove_xss %}
106106
{% endif %}
107107

108108
{% if extra.value.getField().getVariable() == 'linkedin_url' %}
109-
{% set linkedin_url = extra.value.getValue() | escape %}
109+
{% set linkedin_url = extra.value.getValue() | remove_xss %}
110110
{% endif %}
111111
{% endfor %}
112112

@@ -145,7 +145,7 @@
145145
{% for item in extra_info %}
146146
{% if item.variable != 'langue_cible' %}
147147
<dt>{{ item.label }}:</dt>
148-
<dd>{{ item.value }}</dd>
148+
<dd>{{ item.value | remove_xss }}</dd>
149149
{% endif %}
150150
{% endfor %}
151151
</dl>

0 commit comments

Comments
 (0)