Skip to content

Commit

Permalink
Security: Add script tags filter to friends search in social network
Browse files Browse the repository at this point in the history
  • Loading branch information
ywarnier committed Jul 20, 2021
1 parent de43a77 commit 3fcc751
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main/social/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
'name' => get_lang('SocialNetwork'),
];

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

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

$groups = [];
$totalGroups = [];
Expand Down Expand Up @@ -201,7 +201,7 @@
</div>
<div class="user-info">
'.$item_1.'
<p>'.$members.'</p>
<p>'.$members.'</p>
<p>'.$group['description'].'</p>
<p>'.$tags.'</p>
<p>'.$url_open.get_lang('SeeMore').$url_close.'</p>
Expand Down

0 comments on commit 3fcc751

Please sign in to comment.