diff --git a/core/bug_api.php b/core/bug_api.php index daa08f7121..cb340a1c00 100644 --- a/core/bug_api.php +++ b/core/bug_api.php @@ -741,7 +741,9 @@ function bug_cache_row( $p_bug_id, $p_trigger_errors = true ) { $t_query = 'SELECT * FROM {bug} WHERE id=' . db_param(); $t_result = db_query( $t_query, array( $c_bug_id ) ); - if( 0 == db_num_rows( $t_result ) ) { + $t_row = db_fetch_array( $t_result ); + + if( !$t_row ) { $g_cache_bug[$c_bug_id] = false; if( $p_trigger_errors ) { @@ -752,8 +754,6 @@ function bug_cache_row( $p_bug_id, $p_trigger_errors = true ) { } } - $t_row = db_fetch_array( $t_result ); - return bug_add_to_cache( $t_row ); } @@ -845,7 +845,9 @@ function bug_text_cache_row( $p_bug_id, $p_trigger_errors = true ) { WHERE b.id=' . db_param() . ' AND b.bug_text_id = bt.id'; $t_result = db_query( $t_query, array( $c_bug_id ) ); - if( 0 == db_num_rows( $t_result ) ) { + $t_row = db_fetch_array( $t_result ); + + if( !$t_row ) { $g_cache_bug_text[$c_bug_id] = false; if( $p_trigger_errors ) { @@ -856,8 +858,6 @@ function bug_text_cache_row( $p_bug_id, $p_trigger_errors = true ) { } } - $t_row = db_fetch_array( $t_result ); - $g_cache_bug_text[$c_bug_id] = $t_row; return $t_row; diff --git a/core/filter_api.php b/core/filter_api.php index dd7a2549cd..03a5a360e8 100644 --- a/core/filter_api.php +++ b/core/filter_api.php @@ -4431,7 +4431,9 @@ function filter_cache_row( $p_filter_id, $p_trigger_errors = true ) { $t_query = 'SELECT * FROM {filters} WHERE id=' . db_param(); $t_result = db_query( $t_query, array( $p_filter_id ) ); - if( 0 == db_num_rows( $t_result ) ) { + $t_row = db_fetch_array( $t_result ); + + if( !$t_row ) { if( $p_trigger_errors ) { error_parameters( $p_filter_id ); trigger_error( ERROR_FILTER_NOT_FOUND, ERROR ); @@ -4440,8 +4442,6 @@ function filter_cache_row( $p_filter_id, $p_trigger_errors = true ) { } } - $t_row = db_fetch_array( $t_result ); - $g_cache_filter[$p_filter_id] = $t_row; return $t_row;