Skip to content

Commit

Permalink
Fix infinite loop when adding email recipients
Browse files Browse the repository at this point in the history
Commit fbd6540 introduced a regression
preventing the addition of bugnotes as a PHP Fatal error:  Maximum
execution time of 30 seconds exceeded was triggered.

Fixes #16507
  • Loading branch information
dregad committed Oct 18, 2013
1 parent 5ea4f8f commit dc3266a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/email_api.php
Expand Up @@ -264,7 +264,8 @@ function email_collect_recipients( $p_bug_id, $p_notify_type, $p_extra_user_ids_
WHERE bug_id=" . db_param();
$t_result = db_query_bound( $t_query, array( $p_bug_id ) );

while( $t_user_id = db_result( $t_result ) ) {
while( $t_row = db_fetch_array( $t_result ) ) {
$t_user_id = $t_row['user_id'];
$t_recipients[$t_user_id] = true;
log_event( LOG_EMAIL_RECIPIENT, sprintf( 'Issue = #%d, add Monitor = @U%d', $p_bug_id, $t_user_id ) );
}
Expand All @@ -283,8 +284,8 @@ function email_collect_recipients( $p_bug_id, $p_notify_type, $p_extra_user_ids_
FROM $t_bugnote_table
WHERE bug_id = " . db_param();
$t_result = db_query_bound( $t_query, array( $p_bug_id ) );

while( $t_user_id = db_result( $t_result ) ) {
while( $t_row = db_fetch_array( $t_result ) ) {
$t_user_id = $t_row['reporter_id'];
$t_recipients[$t_user_id] = true;
log_event( LOG_EMAIL_RECIPIENT, sprintf( 'Issue = #%d, add Note Author = @U%d', $p_bug_id, $t_user_id ) );
}
Expand Down

0 comments on commit dc3266a

Please sign in to comment.