From a841fe70a8234bf158165105339e32aa5ceb75a2 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 17 Jan 2007 18:41:49 +0000 Subject: ok, handled some bugs... the most important being validate_username (the variable passed to validate_data([...]array('username', [...])) and updating group listings while doing relevant group actions. Oh, and PM icons are working now. :o git-svn-id: file:///svn/phpbb/trunk@6894 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'phpBB/includes/functions.php') diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index c9d820ae03..7a99a551cc 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1285,8 +1285,11 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add { global $template, $user; + // Make sure $per_page is a valid value + $per_page = ($per_page <= 0) ? 1 : $per_page; + $seperator = '' . $user->lang['PAGINATION_SEPERATOR'] . ''; - $total_pages = ceil($num_items/$per_page); + $total_pages = ceil($num_items / $per_page); if ($total_pages == 1 || !$num_items) { @@ -1361,6 +1364,9 @@ function on_page($num_items, $per_page, $start) { global $template, $user; + // Make sure $per_page is a valid value + $per_page = ($per_page <= 0) ? 1 : $per_page; + $on_page = floor($start / $per_page) + 1; $template->assign_vars(array( @@ -1503,12 +1509,6 @@ function redirect($url, $return = false) // Make sure no &'s are in, this will break the redirect $url = str_replace('&', '&', $url); - // Make sure no linebreaks are there... to prevent http response splitting for PHP < 4.4.2 - if (strpos(urldecode($url), "\n") !== false || strpos(urldecode($url), "\r") !== false) - { - trigger_error('Tried to redirect to potentially insecure url.', E_USER_ERROR); - } - // Determine which type of redirect we need to handle... $url_parts = parse_url($url); -- cgit v1.2.1