diff options
author | James Edwards-Jones <jedwardsjones@gitlab.com> | 2018-06-14 02:02:32 +0300 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2018-06-14 02:02:32 +0300 |
commit | 202bd2da16942ca8c9b667b10c75025a0c95980d (patch) | |
tree | 36d1fce86be64e8e0d1748932028b6b3dedf203a /app | |
parent | adb069881ae0253c5bf3718aded02976f13fc859 (diff) |
Backport InternalRedirect#sanitize_redirect
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/concerns/internal_redirect.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/concerns/internal_redirect.rb b/app/controllers/concerns/internal_redirect.rb index 7409b2e89a5..10b9852e329 100644 --- a/app/controllers/concerns/internal_redirect.rb +++ b/app/controllers/concerns/internal_redirect.rb @@ -23,6 +23,10 @@ module InternalRedirect nil end + def sanitize_redirect(url_or_path) + safe_redirect_path(url_or_path) || safe_redirect_path_for_url(url_or_path) + end + def host_allowed?(uri) uri.host == request.host && uri.port == request.port |