Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GitLab
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
projects.thm.de
GitLab
Commits
a10ab94b
Commit
a10ab94b
authored
Jan 13, 2016
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gracefully handle invalid UTF-8 sequences in Markdown links
Closes #6077
parent
f8f96994
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
0 deletions
+3
-0
CHANGELOG
CHANGELOG
+1
-0
lib/banzai/filter/reference_filter.rb
lib/banzai/filter/reference_filter.rb
+2
-0
No files found.
CHANGELOG
View file @
a10ab94b
...
...
@@ -13,6 +13,7 @@ v 8.4.0 (unreleased)
- Autocomplete data is now always loaded, instead of when focusing a comment text area
- Improved performance of finding issues for an entire group
- Added custom application performance measuring system powered by InfluxDB
- Gracefully handle invalid UTF-8 sequences in Markdown links (Stan Hu)
- Bump fog to 1.36.0 (Stan Hu)
- Add user's last used IP addresses to admin page (Stan Hu)
- Add housekeeping function to project settings page
...
...
lib/banzai/filter/reference_filter.rb
View file @
a10ab94b
...
...
@@ -133,6 +133,7 @@ def replace_link_nodes_with_text(pattern)
next
unless
link
&&
text
link
=
CGI
.
unescape
(
link
)
next
unless
link
.
force_encoding
(
'UTF-8'
).
valid_encoding?
# Ignore ending punctionation like periods or commas
next
unless
link
==
text
&&
text
=~
/\A
#{
pattern
}
/
...
...
@@ -170,6 +171,7 @@ def replace_link_nodes_with_href(pattern)
next
unless
link
&&
text
link
=
CGI
.
unescape
(
link
)
next
unless
link
.
force_encoding
(
'UTF-8'
).
valid_encoding?
next
unless
link
&&
link
=~
/\A
#{
pattern
}
\z/
html
=
yield
link
,
text
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment