Fix r8929 and #35275

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9004 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Chris Smith 2008-10-11 18:44:53 +00:00
parent 213773e368
commit b588a36a22

View file

@ -945,10 +945,13 @@ switch ($mode)
$field = request_var('field', '');
$select_single = request_var('select_single', false);
// Search URL parameters, if any of these are in the URL we do a search
$search_params = array('username', 'email', 'icq', 'aim', 'yahoo', 'msn', 'jabber', 'search_group_id', 'joined_select', 'active_select', 'count_select', 'joined', 'active', 'count', 'ip');
// We validate form and field here, only id/class allowed
$form = (!preg_match('/^[a-z0-9_-]+$/i', $form)) ? '' : $form;
$field = (!preg_match('/^[a-z0-9_-]+$/i', $field)) ? '' : $field;
if ($mode == 'searchuser' && ($config['load_search'] || $auth->acl_get('a_')))
if (($mode == 'searchuser' || sizeof(array_intersect(array_keys($_GET), $search_params)) > 0) && ($config['load_search'] || $auth->acl_get('a_')))
{
$username = request_var('username', '', true);
$email = strtolower(request_var('email', ''));
@ -1253,14 +1256,17 @@ switch ($mode)
}
}
$u_hide_find_member = append_sid("{$phpbb_root_path}memberlist.$phpEx", "start=$start" . implode('&', $params));
$u_hide_find_member = append_sid("{$phpbb_root_path}memberlist.$phpEx", "start=$start" . (!empty($params) ? '&' . implode('&', $params) : ''));
if ($mode)
{
$params[] = "mode=$mode";
$sort_params[] = "mode=$mode";
}
$pagination_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", implode('&', $params));
$sort_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", implode('&', $sort_params));
unset($params, $sort_params);
unset($search_params, $sort_params);
// Some search user specific data
if ($mode == 'searchuser' && ($config['load_search'] || $auth->acl_get('a_')))
@ -1468,7 +1474,7 @@ switch ($mode)
'JABBER_IMG' => $user->img('icon_contact_jabber', $user->lang['JABBER']),
'SEARCH_IMG' => $user->img('icon_user_search', $user->lang['SEARCH']),
'U_FIND_MEMBER' => ($config['load_search'] || $auth->acl_get('a_')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser' . (($start) ? "&start=$start" : '')) : '',
'U_FIND_MEMBER' => ($config['load_search'] || $auth->acl_get('a_')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser' . (($start) ? "&start=$start" : '') . (!empty($params) ? '&' . implode('&', $params) : '')) : '',
'U_HIDE_FIND_MEMBER' => ($mode == 'searchuser') ? $u_hide_find_member : '',
'U_SORT_USERNAME' => $sort_url . '&sk=a&sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a'),
'U_SORT_FROM' => $sort_url . '&sk=b&sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a'),