Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
378ee1da
Commit
378ee1da
authored
Aug 30, 2017
by
Jacopo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unescape HTML characters in Wiki title
The special characters of a wiki title are now escaped correctly.
parent
f35d7d7f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
app/models/wiki_page.rb
app/models/wiki_page.rb
+1
-1
changelogs/unreleased/35686-unescape-wiki-title.yml
changelogs/unreleased/35686-unescape-wiki-title.yml
+5
-0
spec/models/wiki_page_spec.rb
spec/models/wiki_page_spec.rb
+6
-0
No files found.
app/models/wiki_page.rb
View file @
378ee1da
...
...
@@ -84,7 +84,7 @@ class WikiPage
# The formatted title of this page.
def
title
if
@attributes
[
:title
]
self
.
class
.
unhyphenize
(
@attributes
[
:title
]
)
CGI
.
unescape_html
(
self
.
class
.
unhyphenize
(
@attributes
[
:title
])
)
else
""
end
...
...
changelogs/unreleased/35686-unescape-wiki-title.yml
0 → 100644
View file @
378ee1da
---
title
:
Unescape HTML characters in Wiki title
merge_request
:
13942
author
:
Jacopo Beschi @jacopo-beschi
type
:
fixed
spec/models/wiki_page_spec.rb
View file @
378ee1da
...
...
@@ -281,6 +281,12 @@ describe WikiPage do
@page
.
title
=
"Import-existing-repositories-into-GitLab"
expect
(
@page
.
title
).
to
eq
(
"Import existing repositories into GitLab"
)
end
it
'unescapes html'
do
@page
.
title
=
'foo & bar'
expect
(
@page
.
title
).
to
eq
(
'foo & bar'
)
end
end
describe
'#directory'
do
...
...
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