From 2ffa1ea0071323caa4357a15a2b5214186d488d1 Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Wed, 17 Jun 2009 21:12:58 -0500 Subject: [PATCH] Cleanup And a fix from Ari Stern. --- app/controllers/file_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/file_controller.rb b/app/controllers/file_controller.rb index 25e613ad..03817c2a 100644 --- a/app/controllers/file_controller.rb +++ b/app/controllers/file_controller.rb @@ -7,8 +7,8 @@ class FileController < ApplicationController layout 'default' - before_filter :dnsbl_check - before_filter :check_allow_uploads, :except => :file + before_filter :dnsbl_check, :check_authorized + before_filter :check_allow_uploads, :except => [:file, :blahtex_png] def file @file_name = params['id'] @@ -28,7 +28,7 @@ class FileController < ApplicationController # no form supplied, this is a request to download the file file = @web.files_path + '/' + @file_name if File.exists?(file) - send_file(file) if check_authorized + send_file(file) else return unless check_allow_uploads @file = WikiFile.new(:file_name => @file_name) @@ -38,7 +38,7 @@ class FileController < ApplicationController end def blahtex_png - send_file(@web.blahtex_pngs_path + '/' + params['id']) if check_authorized + send_file(@web.blahtex_pngs_path + '/' + params['id']) end def delete