From b0abf3d1e1e843b089d50bca742ebbe51edbc197 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 4 Aug 2021 20:12:27 +0800 Subject: [PATCH] fix error --- app/controllers/announcements_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb index b50b6a2..ea21325 100644 --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -497,7 +497,7 @@ class AnnouncementsController < ApplicationController end def get_file @url = request.path - render :text => "Path not allow",:status => 404 and return if @url.match(/\/\.\./) + render :file => "#{Rails.root}/app/views/errors/404.html", :layout => false, :status => :not_found, :content_type => 'text/html' and return if @url.match(/\/\.\./) begin file = BulletinFile.find(params[:id]) if File.basename(file.file.path) != URI.decode(params[:f_name])