Skip to content

Commit

Permalink
Check project existence before access level
Browse files Browse the repository at this point in the history
Failure to do so causes "Project not found" error when a user has a
cached filter on a project that has been deleted.

Fixes #17520
  • Loading branch information
dregad committed Aug 7, 2014
1 parent 794b1d7 commit 15c75c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/filter_api.php
Expand Up @@ -1168,7 +1168,8 @@ function filter_get_bug_rows( &$p_page_number, &$p_per_page, &$p_page_count, &$p
}

# filter out inaccessible projects.
if( !access_has_project_level( VIEWER, $t_pid, $t_user_id ) ) {
if( !project_exists( $t_pid ) || !access_has_project_level( VIEWER, $t_pid, $t_user_id ) ) {
log_event( LOG_FILTERING, 'Invalid or inaccessible project: ' . $t_pid );
continue;
}

Expand Down

0 comments on commit 15c75c6

Please sign in to comment.