summaryrefslogtreecommitdiff
path: root/app/helpers/blob_helper.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-04-13 12:21:07 -0500
committerDouwe Maan <douwe@selenight.nl>2017-04-27 12:23:26 -0500
commit5cb27e9fa74c7234195e10ade933e8a475cff403 (patch)
tree954cbdb45d3d0bea3b4dea33805dff4ab0d83646 /app/helpers/blob_helper.rb
parentf112a03cba884aa67d5d601520d4c05ce517f28a (diff)
downloadgitlab-ce-5cb27e9fa74c7234195e10ade933e8a475cff403.tar.gz
Add rich blob viewers
Diffstat (limited to 'app/helpers/blob_helper.rb')
-rw-r--r--app/helpers/blob_helper.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb
index 36b16421e8f..ade9e19cea8 100644
--- a/app/helpers/blob_helper.rb
+++ b/app/helpers/blob_helper.rb
@@ -134,12 +134,15 @@ module BlobHelper
end
end
+ def blob_raw_url
+ namespace_project_raw_path(@project.namespace, @project, @id)
+ end
+
# SVGs can contain malicious JavaScript; only include whitelisted
# elements and attributes. Note that this whitelist is by no means complete
# and may omit some elements.
- def sanitize_svg(blob)
- blob.data = Gitlab::Sanitizers::SVG.clean(blob.data)
- blob
+ def sanitize_svg_data(data)
+ Gitlab::Sanitizers::SVG.clean(data)
end
# If we blindly set the 'real' content type when serving a Git blob we