提交 15ad0ac1 编写于 作者: S Sean McGivern

Merge branch '35686-unescape-wiki-title' into 'master'

Unescape HTML characters in Wiki title

Closes #35686

See merge request !13942
......@@ -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
......
---
title: Unescape HTML characters in Wiki title
merge_request: 13942
author: Jacopo Beschi @jacopo-beschi
type: fixed
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册