summaryrefslogtreecommitdiff
path: root/app/helpers/blob_helper.rb
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2016-06-14 00:31:45 +0300
committerFatih Acet <acetfatih@gmail.com>2016-06-14 00:31:45 +0300
commit6dbca80c46093443e69f3faace6f1967570b15fa (patch)
treed3e351e4ed25c347978f33176c729c0495b7de74 /app/helpers/blob_helper.rb
parent8c058e8563c287817b81a9a122ceeb5a69f6b221 (diff)
parent4a8ae77ebac46545fa4811ea60bf53d1e81f10fc (diff)
downloadgitlab-ce-remove-comment-toggle.tar.gz
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into remove-comment-toggleremove-comment-toggle
Diffstat (limited to 'app/helpers/blob_helper.rb')
-rw-r--r--app/helpers/blob_helper.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb
index 474c6f27374..cec2dc753fe 100644
--- a/app/helpers/blob_helper.rb
+++ b/app/helpers/blob_helper.rb
@@ -131,7 +131,7 @@ module BlobHelper
# elements and attributes. Note that this whitelist is by no means complete
# and may omit some elements.
def sanitize_svg(blob)
- blob.data = Loofah.scrub_fragment(blob.data, :strip).to_xml
+ blob.data = Gitlab::Sanitizers::SVG.clean(blob.data)
blob
end
@@ -184,4 +184,14 @@ module BlobHelper
Other: licenses.reject(&:featured).map { |license| [license.name, license.key] }
}
end
+
+ def gitignore_names
+ return @gitignore_names if defined?(@gitignore_names)
+
+ @gitignore_names = {
+ Global: Gitlab::Gitignore.global.map { |gitignore| { name: gitignore.name } },
+ # Note that the key here doesn't cover it really
+ Languages: Gitlab::Gitignore.languages_frameworks.map{ |gitignore| { name: gitignore.name } }
+ }
+ end
end