Skip to content

Commit aced30e

Browse files
committed
Security: Escape fields in template.
1 parent 3f20a85 commit aced30e

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

main/template/default/social/user_block.tpl

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
</a>
1010
{% if _u.is_admin == 1 %}
1111
<div class="pull-right">
12-
<a class="btn btn-default btn-sm btn-social-edit" title="{{ "Edit"|get_lang }}" href="{{ _p.web }}main/admin/user_edit.php?user_id={{ user.id }}">
12+
<a class="btn btn-default btn-sm btn-social-edit"
13+
title="{{ "Edit"|get_lang }}"
14+
href="{{ _p.web }}main/admin/user_edit.php?user_id={{ user.id }}"
15+
>
1316
<i class="fa fa-pencil" aria-hidden="true"></i>
1417
</a>
1518
</div>
@@ -99,11 +102,11 @@
99102
{% set linkedin_url = '' %}
100103
{% for extra in user.extra %}
101104
{% if extra.value.getField().getVariable() == 'skype' %}
102-
{% set skype_account = extra.value.getValue() %}
105+
{% set skype_account = extra.value.getValue() | escape %}
103106
{% endif %}
104107

105108
{% if extra.value.getField().getVariable() == 'linkedin_url' %}
106-
{% set linkedin_url = extra.value.getValue() %}
109+
{% set linkedin_url = extra.value.getValue() | escape %}
107110
{% endif %}
108111
{% endfor %}
109112

@@ -127,7 +130,10 @@
127130
{% if user.user_is_online_in_chat != 0 %}
128131
{% if user_relation == user_relation_type_friend %}
129132
<li class="item">
130-
<a onclick="javascript:chatWith('{{ user.id }}', '{{ user.complete_name }}', '{{ user.user_is_online }}','{{ user.avatar_small }}')" href="javascript:void(0);">
133+
<a
134+
onclick="javascript:chatWith('{{ user.id }}', '{{ user.complete_name }}', '{{ user.user_is_online }}','{{ user.avatar_small }}')"
135+
href="javascript:void(0);"
136+
>
131137
<img src="{{ "online.png" | icon }}" alt="{{ "Online" | get_lang }}">
132138
{{ "Chat" | get_lang }} ({{ "Online" | get_lang }})
133139
</a>
@@ -145,11 +151,11 @@
145151
</dl>
146152

147153
{% if not profile_edition_link is empty %}
148-
<li class="item">
149-
<a class="btn btn-default btn-sm btn-block" href="{{ profile_edition_link }}">
150-
<em class="fa fa-edit"></em>{{ "EditProfile" | get_lang }}
151-
</a>
152-
</li>
154+
<li class="item">
155+
<a class="btn btn-default btn-sm btn-block" href="{{ profile_edition_link }}">
156+
<em class="fa fa-edit"></em>{{ "EditProfile" | get_lang }}
157+
</a>
158+
</li>
153159
{% endif %}
154160
</ul>
155161
</div>

0 commit comments

Comments
 (0)