Skip to content

Commit 3fcc751

Browse files
committed
Security: Add script tags filter to friends search in social network
1 parent de43a77 commit 3fcc751

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: main/social/search.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
'name' => get_lang('SocialNetwork'),
2424
];
2525

26-
$query = isset($_GET['q']) ? Security::remove_XSS($_GET['q']) : null;
26+
$query = isset($_GET['q']) ? htmlentities($_GET['q']) : null;
2727

28-
$queryNoFilter = isset($_GET['q']) ? $_GET['q'] : null;
28+
$queryNoTags = isset($_GET['q']) ? strip_tags($_GET['q']) : null;
2929
$query_search_type = isset($_GET['search_type']) && in_array($_GET['search_type'], ['0', '1', '2']) ? $_GET['search_type'] : null;
3030
$extra_fields = UserManager::getExtraFilterableFields();
3131
$query_vars = ['q' => $query, 'search_type' => $query_search_type];
@@ -41,7 +41,7 @@
4141
//Block Social Menu
4242
$social_menu_block = SocialManager::show_social_menu('search');
4343
$block_search = '';
44-
$searchForm = UserManager::get_search_form($queryNoFilter);
44+
$searchForm = UserManager::get_search_form($queryNoTags);
4545

4646
$groups = [];
4747
$totalGroups = [];
@@ -201,7 +201,7 @@
201201
</div>
202202
<div class="user-info">
203203
'.$item_1.'
204-
<p>'.$members.'</p>
204+
<p>'.$members.'</p>
205205
<p>'.$group['description'].'</p>
206206
<p>'.$tags.'</p>
207207
<p>'.$url_open.get_lang('SeeMore').$url_close.'</p>

0 commit comments

Comments
 (0)