From: <gi...@ma...> - 2010-02-25 06:09:16
|
The branch, master-1.2.x has been updated via 0f00ee7992babfe03a99bf1caf8f75b156423b53 (commit) from 09b7815eb6eb10e5dc999869a4674deed0aa3b93 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 0f00ee7992babfe03a99bf1caf8f75b156423b53 Author: David Hicks <hic...@op...> Date: Thu Feb 25 17:02:02 2010 +1100 current_user_get_bug_filter() can return false When calling current_user_get_bug_filter(), we need to check if the return value is boolean false. If so, we need to get the default filter instead of the current user's filter. Also, current_user_get_bug_filter() already validates the filter to ensure it is correct, so there is no need to validate it a second time. ----------------------------------------------------------------------- Summary of changes: core/current_user_api.php | 2 +- my_view_inc.php | 1 - return_dynamic_filters.php | 4 +++- view_all_inc.php | 3 +-- view_filters_page.php | 4 +++- 5 files changed, 8 insertions(+), 6 deletions(-) ----------------------------------------------------------------------- commit 0f00ee7992babfe03a99bf1caf8f75b156423b53 Author: David Hicks <hic...@op...> Date: Thu Feb 25 17:02:02 2010 +1100 current_user_get_bug_filter() can return false When calling current_user_get_bug_filter(), we need to check if the return value is boolean false. If so, we need to get the default filter instead of the current user's filter. Also, current_user_get_bug_filter() already validates the filter to ensure it is correct, so there is no need to validate it a second time. diff --git a/core/current_user_api.php b/core/current_user_api.php index d51caa2..2c5f7e1 100644 --- a/core/current_user_api.php +++ b/core/current_user_api.php @@ -187,7 +187,7 @@ function current_user_ensure_unprotected() { /** * Returns the issue filter parameters for the current user * - * @return Active issue filter for current user. + * @return Active issue filter for current user or false if no filter is currently defined. * @access public */ function current_user_get_bug_filter( $p_project_id = null ) { diff --git a/my_view_inc.php b/my_view_inc.php index 97c131c..bbc9dfe 100644 --- a/my_view_inc.php +++ b/my_view_inc.php @@ -43,7 +43,6 @@ require_once( 'date_api.php' ); require_once( 'icon_api.php' ); $t_filter = current_user_get_bug_filter(); - if( $t_filter === false ) { $t_filter = filter_get_default(); } diff --git a/return_dynamic_filters.php b/return_dynamic_filters.php index a8deadb..eb35203 100644 --- a/return_dynamic_filters.php +++ b/return_dynamic_filters.php @@ -39,7 +39,9 @@ global $t_filter; global $t_select_modifier; $t_filter = current_user_get_bug_filter(); - $t_filter = filter_ensure_valid_filter( $t_filter ); + if( $t_filter === false ) { + $t_filter = filter_get_default(); + } $t_project_id = helper_get_current_project(); $t_current_user_access_level = current_user_get_access_level(); $t_accessible_custom_fields_ids = array(); diff --git a/view_all_inc.php b/view_all_inc.php index 801ac3b..a205f27 100644 --- a/view_all_inc.php +++ b/view_all_inc.php @@ -47,9 +47,8 @@ require_once( 'columns_api.php' ); $t_filter = current_user_get_bug_filter(); - # NOTE: this check might be better placed in current_user_get_bug_filter() - if ( !$t_filter ) { + if ( $t_filter === false ) { $t_filter = filter_get_default(); } diff --git a/view_filters_page.php b/view_filters_page.php index 770ccef..2425485 100644 --- a/view_filters_page.php +++ b/view_filters_page.php @@ -95,7 +95,9 @@ /** @todo thraxisp - could this be replaced by a call to filter_draw_selection_area2 */ $t_filter = current_user_get_bug_filter(); - $t_filter = filter_ensure_valid_filter( $t_filter ); + if( $t_filter === false ) { + $t_filter = filter_get_default(); + } $t_project_id = helper_get_current_project(); $t_current_user_access_level = current_user_get_access_level(); ----------------------------------------------------------------------- -- Mantis Bug Tracker |