BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
bfb32b46
Commit
bfb32b46
authored
Feb 05, 2018
by
Robert Speicher
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix/gitaly-wiki-encoding-issues' into 'master'
Encode GitalyClient::WikiPage attributes to UTF-8 See merge request gitlab-org/gitlab-ce!16925
parents
0e15a5b8
be26c4e7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
wiki_page.rb
lib/gitlab/gitaly_client/wiki_page.rb
+5
-0
project_wiki_spec.rb
spec/models/project_wiki_spec.rb
+12
-1
No files found.
lib/gitlab/gitaly_client/wiki_page.rb
View file @
bfb32b46
...
...
@@ -4,6 +4,7 @@ module Gitlab
ATTRS
=
%i(title format url_path path name historical raw_data)
.
freeze
include
AttributesBag
include
Gitlab
::
EncodingHelper
def
initialize
(
params
)
super
...
...
@@ -11,6 +12,10 @@ module Gitlab
# All gRPC strings in a response are frozen, so we get an unfrozen
# version here so appending to `raw_data` doesn't blow up.
@raw_data
=
@raw_data
.
dup
@title
=
encode_utf8
(
@title
)
@path
=
encode_utf8
(
@path
)
@name
=
encode_utf8
(
@name
)
end
def
historical?
...
...
spec/models/project_wiki_spec.rb
View file @
bfb32b46
...
...
@@ -127,7 +127,7 @@ describe ProjectWiki do
end
after
do
destroy_page
(
subject
.
pages
.
first
.
page
)
subject
.
pages
.
each
{
|
page
|
destroy_page
(
page
.
page
)
}
end
it
"returns the latest version of the page if it exists"
do
...
...
@@ -148,6 +148,17 @@ describe ProjectWiki do
page
=
subject
.
find_page
(
"index page"
)
expect
(
page
).
to
be_a
WikiPage
end
context
'pages with multibyte-character title'
do
before
do
create_page
(
"autre pagé"
,
"C'est un génial Gollum Wiki"
)
end
it
"can find a page by slug"
do
page
=
subject
.
find_page
(
"autre pagé"
)
expect
(
page
.
title
).
to
eq
(
"autre pagé"
)
end
end
end
context
'when Gitaly wiki_find_page is enabled'
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