mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: allow login required sites access to attachements
This commit is contained in:
parent
761f4afd85
commit
a92f61e926
1 changed files with 0 additions and 1 deletions
|
@ -52,7 +52,6 @@ class UploadsController < ApplicationController
|
||||||
RailsMultisite::ConnectionManagement.with_connection(params[:site]) do |db|
|
RailsMultisite::ConnectionManagement.with_connection(params[:site]) do |db|
|
||||||
return render_404 unless Discourse.store.internal?
|
return render_404 unless Discourse.store.internal?
|
||||||
return render_404 if SiteSetting.prevent_anons_from_downloading_files && current_user.nil?
|
return render_404 if SiteSetting.prevent_anons_from_downloading_files && current_user.nil?
|
||||||
return render_404 if SiteSetting.login_required? && db == "default" && current_user.nil?
|
|
||||||
|
|
||||||
if upload = Upload.find_by(sha1: params[:sha]) || Upload.find_by(id: params[:id], url: request.env["PATH_INFO"])
|
if upload = Upload.find_by(sha1: params[:sha]) || Upload.find_by(id: params[:id], url: request.env["PATH_INFO"])
|
||||||
opts = {
|
opts = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue