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
Jérome Perrin
gitlab-ce
Commits
528f90b4
Commit
528f90b4
authored
Sep 13, 2017
by
Brandon Everett
Committed by
Rémy Coutable
Sep 13, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
escape characters in git user name
parent
c4a1c2ff
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
1 deletion
+17
-1
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+1
-1
changelogs/unreleased/18308-escape-characters.yml
changelogs/unreleased/18308-escape-characters.yml
+5
-0
spec/helpers/projects_helper_spec.rb
spec/helpers/projects_helper_spec.rb
+11
-0
No files found.
app/helpers/projects_helper.rb
View file @
528f90b4
...
@@ -320,7 +320,7 @@ module ProjectsHelper
...
@@ -320,7 +320,7 @@ module ProjectsHelper
def
git_user_name
def
git_user_name
if
current_user
if
current_user
current_user
.
name
current_user
.
name
.
gsub
(
'"'
,
'\"'
)
else
else
_
(
"Your name"
)
_
(
"Your name"
)
end
end
...
...
changelogs/unreleased/18308-escape-characters.yml
0 → 100644
View file @
528f90b4
---
title
:
Escape quotes in git username
merge_request
:
14020
author
:
Brandon Everett
type
:
fixed
spec/helpers/projects_helper_spec.rb
View file @
528f90b4
...
@@ -469,4 +469,15 @@ describe ProjectsHelper do
...
@@ -469,4 +469,15 @@ describe ProjectsHelper do
expect
(
recorder
.
count
).
to
eq
(
1
)
expect
(
recorder
.
count
).
to
eq
(
1
)
end
end
end
end
describe
'#git_user_name'
do
let
(
:user
)
{
double
(
:user
,
name:
'John "A" Doe53'
)
}
before
do
allow
(
helper
).
to
receive
(
:current_user
).
and_return
(
user
)
end
it
'parses quotes in name'
do
expect
(
helper
.
send
(
:git_user_name
)).
to
eq
(
'John \"A\" Doe53'
)
end
end
end
end
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