summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-08-08 18:15:41 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-08-08 18:15:41 +0300
commit2836b47370434bc96cc54766c898577421ba14e2 (patch)
tree3e84b6934995bea8a031d84be5ffdf95fb33b63e /lib
parent71dec8b1b61e9e194d242d37b39416b72020936b (diff)
parentb767d8688511d7fdb9487e96c18eb62788fd629b (diff)
downloadgitlab-ce-2836b47370434bc96cc54766c898577421ba14e2.tar.gz
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
Diffstat (limited to 'lib')
-rw-r--r--lib/banzai/filter/relative_link_filter.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/banzai/filter/relative_link_filter.rb b/lib/banzai/filter/relative_link_filter.rb
index 5b73fc8fcee..46762d401fb 100644
--- a/lib/banzai/filter/relative_link_filter.rb
+++ b/lib/banzai/filter/relative_link_filter.rb
@@ -35,6 +35,7 @@ module Banzai
def process_link_attr(html_attr)
return if html_attr.blank?
+ return if html_attr.value.start_with?('//')
uri = URI(html_attr.value)
if uri.relative? && uri.path.present?
@@ -92,7 +93,7 @@ module Banzai
parts = request_path.split('/')
parts.pop if uri_type(request_path) != :tree
- path.sub!(%r{^\./}, '')
+ path.sub!(%r{\A\./}, '')
while path.start_with?('../')
parts.pop