diff options
author | Bob Van Landuyt <bob@gitlab.com> | 2017-06-16 12:11:33 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@gitlab.com> | 2017-06-21 16:09:35 +0200 |
commit | 79393a351db47afa0df3588b5cdf9fb254c75282 (patch) | |
tree | dea2a56eef6c2c3088449de14aea77b235f4d743 /app/models/concerns/routable.rb | |
parent | cf3cdd48bb4959cb277752a16a4b98b7f4a4f3c4 (diff) | |
download | gitlab-ce-79393a351db47afa0df3588b5cdf9fb254c75282.tar.gz |
Rebuild the dynamic path before validating itbvl-validate-path-update
Otherwise we won't validate updates to the path. Allowing users to
change the path to something that's not allowed.
Diffstat (limited to 'app/models/concerns/routable.rb')
-rw-r--r-- | app/models/concerns/routable.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/app/models/concerns/routable.rb b/app/models/concerns/routable.rb index 63d02b76f6b..ec7796a9dbb 100644 --- a/app/models/concerns/routable.rb +++ b/app/models/concerns/routable.rb @@ -107,6 +107,14 @@ module Routable RequestStore[key] ||= uncached_full_path end + def build_full_path + if parent && path + parent.full_path + '/' + path + else + path + end + end + private def uncached_full_path @@ -135,14 +143,6 @@ module Routable end end - def build_full_path - if parent && path - parent.full_path + '/' + path - else - path - end - end - def update_route prepare_route route.save |