Skip to content
Snippets Groups Projects
Commit 378ee1da authored by Jacopo's avatar Jacopo
Browse files

Unescape HTML characters in Wiki title

The special characters of a wiki title are now escaped correctly.
parent f35d7d7f
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
Loading
Loading
---
title: Unescape HTML characters in Wiki title
merge_request: 13942
author: Jacopo Beschi @jacopo-beschi
type: fixed
Loading
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment