Commit Graph

13 Commits

Author SHA1 Message Date
Phil Hughes 138e26b1fa Adds v-pre to code blocks in comments
Closes #22911
2016-10-04 14:06:44 +01:00
Ahmad Sherif ca823abacd Fix the leak mentioned in 504a3b5 by another way
The previous fix introduced another leak; as it made
Banzai::Filter::SanitizationFiler#customized? always return false, so we
were always appending two elements to
HTML::Pipeline::SanitizationFilter::WHITELIST[:elements]. This growth in
the elements array would slow the sanitization process over time.
2016-09-23 15:29:28 +02:00
Ahmad Sherif 0fe33f925a Revert "Fix a memory leak caused by Banzai::Filter::SanitizationFilter"
This reverts commit 504a3b5e6f.
2016-09-23 15:27:48 +02:00
Ahmad Sherif 504a3b5e6f Fix a memory leak caused by Banzai::Filter::SanitizationFilter
In Banzai::Filter::SanitizationFilter#customize_whitelist, we append
three lambdas that has reference to the SanitizationFilter instance,
which in turn (potentially) has a reference to the following chain:

context hash -> Project instance -> Repository instance -> lookup hash
-> various Rugged instances -> various mmap-ed git pack files.

All of the above is not garbage collected because the array we append
the lambdas to is the constant
HTML::Pipeline::SanitizationFilter::WHITELIST.
2016-08-14 22:28:18 +02:00
Stan Hu 849cc380d8 Use a case-insensitive comparison in sanitizing URI schemes
Closes #1625
2016-05-09 12:47:53 -07:00
Robert Speicher 8558483417 Remove redundant `require`s from Banzai files
We're trying to avoid circular dependency errors.
2016-03-24 13:23:47 -04:00
Robert Speicher 41de7b345b Be more intelligent about sanitizing links with unsafe protocols
This prevents false matches on relative links like
`[database](database.md)`.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/14220
2016-03-14 18:05:01 -04:00
Robert Speicher 989946f337 Sanitize `vbscript:` links
Closes https://dev.gitlab.org/gitlab/gitlabhq/issues/2660
2016-02-23 20:42:03 -05:00
Robert Speicher 4225fd229f Sanitize `data:` links
Closes #13625
2016-02-21 17:33:35 -05:00
Robert Speicher 47982e50c4 Make Pipelines responsible for defining their custom whitelist
This allows for future pipelines to more easily define a custom
whitelist.
2016-02-03 17:24:08 -05:00
Benedict Etzel 6435f78a8c Whitelist raw "abbr" elements when parsing Markdown
Closes #12517
2016-01-23 20:38:06 +01:00
Douwe Maan 2a20c0e590 Prevent circular reference error in Banzai 2016-01-14 11:30:28 +01:00
Douwe Maan 7781bda9bd Move Markdown/reference logic from Gitlab::Markdown to Banzai 2015-12-15 15:51:16 +01:00