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
5142c617
Commit
5142c617
authored
Dec 14, 2015
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cast values to strings before escaping them
This ensures that e.g. line numbers used in tags are first casted to strings.
parent
9f95ff0d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
metrics_worker.rb
app/workers/metrics_worker.rb
+1
-1
metrics_worker_spec.rb
spec/workers/metrics_worker_spec.rb
+4
-0
No files found.
app/workers/metrics_worker.rb
View file @
5142c617
...
@@ -24,6 +24,6 @@ class MetricsWorker
...
@@ -24,6 +24,6 @@ class MetricsWorker
end
end
def
escape_value
(
value
)
def
escape_value
(
value
)
value
.
gsub
(
'='
,
'\\='
)
value
.
to_s
.
gsub
(
'='
,
'\\='
)
end
end
end
end
spec/workers/metrics_worker_spec.rb
View file @
5142c617
...
@@ -36,5 +36,9 @@ describe MetricsWorker do
...
@@ -36,5 +36,9 @@ describe MetricsWorker do
it
'escapes an equals sign'
do
it
'escapes an equals sign'
do
expect
(
worker
.
escape_value
(
'foo='
)).
to
eq
(
'foo\\='
)
expect
(
worker
.
escape_value
(
'foo='
)).
to
eq
(
'foo\\='
)
end
end
it
'casts values to Strings'
do
expect
(
worker
.
escape_value
(
10
)).
to
eq
(
'10'
)
end
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