Skip to content

Commit

Permalink
Move bug existence check before user list validation
Browse files Browse the repository at this point in the history
Issue #11316
  • Loading branch information
dregad committed Mar 7, 2016
1 parent a625150 commit b9387b2
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions bug_monitor_add.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@
$t_bug = bug_get( $f_bug_id, true );
$f_usernames = trim( gpc_get_string( 'username', '' ) );

bug_ensure_exists( $f_bug_id );

if( $t_bug->project_id != helper_get_current_project() ) {
# in case the current project is not the same project of the bug we are
# viewing, override the current project. This to avoid problems with
# categories and handlers lists etc.
$g_project_override = $t_bug->project_id;
}

$t_logged_in_user_id = auth_get_current_user_id();

if( is_blank( $f_usernames ) ) {
Expand All @@ -81,14 +90,6 @@
}
}

bug_ensure_exists( $f_bug_id );

if( $t_bug->project_id != helper_get_current_project() ) {
# in case the current project is not the same project of the bug we are viewing...
# ... override the current project. This to avoid problems with categories and handlers lists etc.
$g_project_override = $t_bug->project_id;
}

# Check all monitors first,
foreach( $t_user_ids as $t_user_id ) {
if( user_is_anonymous( $t_user_id ) ) {
Expand Down

0 comments on commit b9387b2

Please sign in to comment.