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
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@gitlab.com>2018-10-04 19:28:54 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2018-10-04 19:30:49 +0300
commit8344c4ec326cc3026db23c5484e33766310063c3 (patch)
tree69d5a01904392cdd033864e8691bc928f7481fa6 /lib/banzai.rb
parentbcf3ab7cabde73cae6793c70db849d5c91489b4f (diff)
Merge branch 'security-bw-confidential-titles-through-markdown-api-11-2' into 'security-11-2'
[11.2] Confidential issue/private snippet titles can be read by unauthenticated user through GFM markdown API See merge request gitlab/gitlabhq!2534
Diffstat (limited to 'lib/banzai.rb')
-rw-r--r--lib/banzai.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/banzai.rb b/lib/banzai.rb
index 5df98f66f3b..788f29a6c08 100644
--- a/lib/banzai.rb
+++ b/lib/banzai.rb
@@ -1,4 +1,11 @@
module Banzai
+ # if you need to render markdown, then you probably need to post_process as well,
+ # such as removing references that the current user doesn't have
+ # permission to make
+ def self.render_and_post_process(text, context = {})
+ post_process(render(text, context), context)
+ end
+
def self.render(text, context = {})
Renderer.render(text, context)
end