Commit ae76efe982f90e06c0a48c2cf6d9e2bef6b3d7b2
1 parent
dd3eed22
Exists in
master
and in
1 other branch
download block: render not_found with invalir URI
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
src/noosfero-spb/software_communities/controllers/software_communities_plugin_profile_controller.rb
... | ... | @@ -11,7 +11,7 @@ class SoftwareCommunitiesPluginProfileController < ProfileController |
11 | 11 | def download_file |
12 | 12 | download = SoftwareCommunitiesPlugin::Download.where(:id => params[:download_id].to_i).detect{ |b| b.download_block.environment.id == environment.id } |
13 | 13 | |
14 | - if download | |
14 | + if download && (download.link =~ URI::regexp) | |
15 | 15 | download.total_downloads += 1 |
16 | 16 | download.save |
17 | 17 | ... | ... |