mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: not permitted theme params when importing theme
This commit is contained in:
parent
1eda8c50f0
commit
813df1a3fb
@ -26,13 +26,13 @@ class Admin::ThemesController < Admin::AdminController
|
|||||||
|
|
||||||
def import
|
def import
|
||||||
@theme = nil
|
@theme = nil
|
||||||
if params[:theme]
|
uploaded_theme = params.require(:theme)
|
||||||
json = JSON::parse(params[:theme].read)
|
if uploaded_theme
|
||||||
|
json = JSON::parse(uploaded_theme.read)
|
||||||
theme = json['theme']
|
theme = json['theme']
|
||||||
|
|
||||||
@theme = Theme.new(name: theme["name"], user_id: current_user.id)
|
@theme = Theme.new(name: theme["name"], user_id: current_user.id)
|
||||||
theme["theme_fields"]&.each do |field|
|
theme["theme_fields"]&.each do |field|
|
||||||
|
|
||||||
if field["raw_upload"]
|
if field["raw_upload"]
|
||||||
begin
|
begin
|
||||||
tmp = Tempfile.new
|
tmp = Tempfile.new
|
||||||
|
Loading…
Reference in New Issue
Block a user