Skip to content

Commit

Permalink
Trigger generic error when downloading non-existent attachment
Browse files Browse the repository at this point in the history
This prevents PHP warnings and notices as the code attempts to process
an empty result set from the query.

Fixes #19879
  • Loading branch information
dregad committed Jun 24, 2015
1 parent d615a9e commit b96e49d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions file_download.php
Expand Up @@ -91,6 +91,10 @@
}
$t_result = db_query( $t_query, array( $c_file_id ) );
$t_row = db_fetch_array( $t_result );
if( false === $t_row ) {
# Attachment not found
trigger_error( ERROR_GENERIC, ERROR );
}
extract( $t_row, EXTR_PREFIX_ALL, 'v' );

if( $f_type == 'bug' ) {
Expand Down

0 comments on commit b96e49d

Please sign in to comment.