Fix #3913: Remove legacy /post/create.xml endpoint.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
class LegacyController < ApplicationController
|
||||
before_action :member_only, :only => [:create_post]
|
||||
respond_to :json, :xml
|
||||
|
||||
def posts
|
||||
@@ -18,19 +17,6 @@ class LegacyController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
def create_post
|
||||
@upload = Upload.new
|
||||
@upload.server = Socket.gethostname
|
||||
@upload.file = params[:post][:file]
|
||||
@upload.source = params[:post][:source]
|
||||
@upload.tag_string = params[:post][:tags]
|
||||
@upload.parent_id = params[:post][:parent_id]
|
||||
@upload.rating = params[:post][:rating][0].downcase
|
||||
@upload.md5_confirmation = params[:md5] if params[:md5].present?
|
||||
@upload.save
|
||||
@upload.process!
|
||||
end
|
||||
|
||||
def users
|
||||
@users = User.limit(100).search(params).paginate(params[:page])
|
||||
end
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<response>
|
||||
<post-id>0</post-id>
|
||||
<location><%= upload_url(@upload) %></location>
|
||||
</response>
|
||||
@@ -376,7 +376,6 @@ Rails.application.routes.draw do
|
||||
|
||||
get "/post/index.xml", :controller => "legacy", :action => "posts", :format => "xml"
|
||||
get "/post/index.json", :controller => "legacy", :action => "posts", :format => "json"
|
||||
get "/post/create.xml", :controller => "legacy", :action => "create_post", :format => "xml"
|
||||
get "/post/piclens", :controller => "legacy", :action => "unavailable"
|
||||
get "/post/index" => redirect {|params, req| "/posts?tags=#{CGI::escape(req.params[:tags].to_s)}&page=#{req.params[:page]}"}
|
||||
get "/post" => redirect {|params, req| "/posts?tags=#{CGI::escape(req.params[:tags].to_s)}&page=#{req.params[:page]}"}
|
||||
|
||||
Reference in New Issue
Block a user