diff options
author | Chris Smith <toonarmy@phpbb.com> | 2008-10-11 18:44:53 +0000 |
---|---|---|
committer | Chris Smith <toonarmy@phpbb.com> | 2008-10-11 18:44:53 +0000 |
commit | b588a36a220fa5e2a67e1169ee93100200cc735f (patch) | |
tree | d4f2b68e71f7c40826334075c21a5723f6a6cf43 | |
parent | 213773e368c9ac51b15216830d74584674c549f2 (diff) | |
download | forums-b588a36a220fa5e2a67e1169ee93100200cc735f.tar forums-b588a36a220fa5e2a67e1169ee93100200cc735f.tar.gz forums-b588a36a220fa5e2a67e1169ee93100200cc735f.tar.bz2 forums-b588a36a220fa5e2a67e1169ee93100200cc735f.tar.xz forums-b588a36a220fa5e2a67e1169ee93100200cc735f.zip |
Fix r8929 and #35275
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9004 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/memberlist.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 1808c967fa..ccd0568fd6 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -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) : '')); - $params[] = "mode=$mode"; - $sort_params[] = "mode=$mode"; + 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'), |