From ef5fdd3f3c7e46c9c051af094e5472fbe5f0af22 Mon Sep 17 00:00:00 2001 From: Mario de la Ossa Date: Tue, 11 Jun 2019 22:14:40 -0600 Subject: Fix DOS when rendering issue/MR comments --- lib/banzai/filter/relative_link_filter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/banzai') 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 -- cgit v1.2.1