diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-30 22:40:10 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-30 22:40:10 +0000 |
commit | b8cacd68a6297f2c6cdd454a3d82a487367f2e70 (patch) | |
tree | 093014d689cb2c662f8f3f112791d952263a3b1a /config | |
parent | b2ce3643e27db4cc0ad30cc09d651c00ec799887 (diff) | |
download | gitlab-ce-b8cacd68a6297f2c6cdd454a3d82a487367f2e70.tar.gz |
Add latest changes from gitlab-org/security/gitlab@13-10-stable-ee
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/asciidoctor_patch.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/config/initializers/asciidoctor_patch.rb b/config/initializers/asciidoctor_patch.rb new file mode 100644 index 00000000000..b7da50db77c --- /dev/null +++ b/config/initializers/asciidoctor_patch.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +# Ensure that locked attributes can not be changed using a counter. +# TODO: this can be removed once `asciidoctor` gem is > 2.0.12 +# and https://github.com/asciidoctor/asciidoctor/issues/3939 is merged +module Asciidoctor + module DocumentPatch + def counter(name, seed = nil) + return @parent_document.counter(name, seed) if @parent_document # rubocop: disable Gitlab/ModuleWithInstanceVariables + + unless attribute_locked? name + super + end + end + end +end + +class Asciidoctor::Document + prepend Asciidoctor::DocumentPatch +end |