Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMario de la Ossa <mariodelaossa@gmail.com>2019-06-12 07:14:40 +0300
committerMario de la Ossa <mariodelaossa@gmail.com>2019-06-14 04:38:21 +0300
commitef5fdd3f3c7e46c9c051af094e5472fbe5f0af22 (patch)
tree04b15c94b9a3d2ff575e6e98150bd1ac827b817a /lib
parent20bdbc3d0cd716ba49e64db37254ed249cd0c683 (diff)
Fix DOS when rendering issue/MR comments
Diffstat (limited to 'lib')
-rw-r--r--lib/banzai/filter/relative_link_filter.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/banzai/filter/relative_link_filter.rb b/lib/banzai/filter/relative_link_filter.rb
index 199b3533cf4..cdf97e75491 100644
--- a/lib/banzai/filter/relative_link_filter.rb
+++ b/lib/banzai/filter/relative_link_filter.rb
@@ -100,7 +100,7 @@ module Banzai
end
def relative_file_path(uri)
- path = Addressable::URI.unescape(uri.path)
+ path = Addressable::URI.unescape(uri.path).delete("\0")
request_path = Addressable::URI.unescape(context[:requested_path])
nested_path = build_relative_path(path, request_path)
file_exists?(nested_path) ? nested_path : path