diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2006-10-11 10:43:20 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-10-11 10:43:20 +0000 |
| commit | 97c72d7075408cae67fb03215a93371c85e593cd (patch) | |
| tree | 2bc4f414ff6ff8d8a8e72938941ded5365a326a0 /phpBB/includes | |
| parent | a765165cd1280c8f79d7ad99dbdf6dab05375dde (diff) | |
| download | forums-97c72d7075408cae67fb03215a93371c85e593cd.tar forums-97c72d7075408cae67fb03215a93371c85e593cd.tar.gz forums-97c72d7075408cae67fb03215a93371c85e593cd.tar.bz2 forums-97c72d7075408cae67fb03215a93371c85e593cd.tar.xz forums-97c72d7075408cae67fb03215a93371c85e593cd.zip | |
- make sure all sort keys are valid and selectable.
git-svn-id: file:///svn/phpbb/trunk@6477 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
| -rw-r--r-- | phpBB/includes/functions.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 6092d8b0dc..2666f013c5 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -182,6 +182,26 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key, $sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']); + // Check if the key is selectable. If not, we reset to the first key found. + // This ensures the values are always valid. + if (!isset($limit_days[$sort_days])) + { + @reset($limit_days); + $sort_days = key($limit_days); + } + + if (!isset($sort_by_text[$sort_key])) + { + @reset($sort_by_text); + $sort_key = key($sort_by_text); + } + + if (!isset($sort_dir_text[$sort_dir])) + { + @reset($sort_dir_text); + $sort_dir = key($sort_dir_text); + } + $s_limit_days = '<select name="st">'; foreach ($limit_days as $day => $text) { |
