mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
FIX: handle array in redirect param
This commit is contained in:
parent
f4fd75aea4
commit
e2636f0ec7
2 changed files with 10 additions and 2 deletions
|
@ -89,10 +89,11 @@ class StaticController < ApplicationController
|
|||
|
||||
destination = path("/")
|
||||
|
||||
if params[:redirect].present? && !params[:redirect].match(login_path)
|
||||
redirect_location = params[:redirect].to_s
|
||||
if redirect_location.present? && !redirect_location.match(login_path)
|
||||
begin
|
||||
forum_uri = URI(Discourse.base_url)
|
||||
uri = URI(params[:redirect])
|
||||
uri = URI(redirect_location)
|
||||
|
||||
if uri.path.present? &&
|
||||
(uri.host.blank? || uri.host == forum_uri.host) &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue