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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
406f9df9
Commit
406f9df9
authored
Apr 15, 2019
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix EE after removal of the deprecated sanitize
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
ae8bfa83
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
6 additions
and
6 deletions
+6
-6
ee/app/models/project_tracing_setting.rb
ee/app/models/project_tracing_setting.rb
+1
-1
ee/app/views/layouts/nav/sidebar/_tracing_link.html.haml
ee/app/views/layouts/nav/sidebar/_tracing_link.html.haml
+1
-1
ee/app/views/projects/settings/operations/_tracing.html.haml
ee/app/views/projects/settings/operations/_tracing.html.haml
+1
-1
ee/db/post_migrate/20181116100917_sanitize_tracing_external_url.rb
...t_migrate/20181116100917_sanitize_tracing_external_url.rb
+1
-1
ee/spec/migrations/sanitize_tracing_external_url_spec.rb
ee/spec/migrations/sanitize_tracing_external_url_spec.rb
+1
-1
ee/spec/models/project_tracing_setting_spec.rb
ee/spec/models/project_tracing_setting_spec.rb
+1
-1
No files found.
ee/app/models/project_tracing_setting.rb
View file @
406f9df9
...
@@ -10,6 +10,6 @@ class ProjectTracingSetting < ApplicationRecord
...
@@ -10,6 +10,6 @@ class ProjectTracingSetting < ApplicationRecord
private
private
def
sanitize_external_url
def
sanitize_external_url
self
.
external_url
=
ActionController
::
Base
.
helpers
.
sanitize
(
self
.
external_url
,
tags:
[]
)
self
.
external_url
=
Rails
::
Html
::
FullSanitizer
.
new
.
sanitize
(
self
.
external_url
)
end
end
end
end
ee/app/views/layouts/nav/sidebar/_tracing_link.html.haml
View file @
406f9df9
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
-
if
project_nav_tab?
:settings
-
if
project_nav_tab?
:settings
=
nav_link
(
controller: :tracings
,
action:
[
:show
])
do
=
nav_link
(
controller: :tracings
,
action:
[
:show
])
do
-
if
@project
.
tracing_external_url
.
present?
-
if
@project
.
tracing_external_url
.
present?
=
link_to
sanitize
(
@project
.
tracing_external_url
,
tags:
[]
),
target:
"_blank"
,
rel:
'noopener noreferrer'
do
=
link_to
sanitize
(
@project
.
tracing_external_url
,
scrubber:
Rails
::
Html
::
TextOnlyScrubber
.
new
),
target:
"_blank"
,
rel:
'noopener noreferrer'
do
%span
%span
=
_
(
'Tracing'
)
=
_
(
'Tracing'
)
%i
.strong.ml-1.fa.fa-external-link
%i
.strong.ml-1.fa.fa-external-link
...
...
ee/app/views/projects/settings/operations/_tracing.html.haml
View file @
406f9df9
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
=
_
(
"Jaeger tracing"
)
=
_
(
"Jaeger tracing"
)
%p
%p
-
if
has_jaeger_url
-
if
has_jaeger_url
-
tracing_link
=
link_to
sanitize
(
@project
.
tracing_external_url
,
tags:
[]
),
target:
"_blank"
,
rel:
'noopener noreferrer'
do
-
tracing_link
=
link_to
sanitize
(
@project
.
tracing_external_url
,
scrubber:
Rails
::
Html
::
TextOnlyScrubber
.
new
),
target:
"_blank"
,
rel:
'noopener noreferrer'
do
%span
%span
=
_
(
'Tracing'
)
=
_
(
'Tracing'
)
=
sprite_icon
(
'external-link'
,
size:
16
,
css_class:
'ml-1 vertical-align-middle'
)
=
sprite_icon
(
'external-link'
,
size:
16
,
css_class:
'ml-1 vertical-align-middle'
)
...
...
ee/db/post_migrate/20181116100917_sanitize_tracing_external_url.rb
View file @
406f9df9
...
@@ -15,7 +15,7 @@ class SanitizeTracingExternalUrl < ActiveRecord::Migration[4.2]
...
@@ -15,7 +15,7 @@ class SanitizeTracingExternalUrl < ActiveRecord::Migration[4.2]
self
.
table_name
=
'project_tracing_settings'
self
.
table_name
=
'project_tracing_settings'
def
sanitize_external_url
def
sanitize_external_url
self
.
external_url
=
ActionController
::
Base
.
helpers
.
sanitize
(
self
.
external_url
,
tags:
[]
)
self
.
external_url
=
Rails
::
Html
::
FullSanitizer
.
new
.
sanitize
(
self
.
external_url
)
end
end
end
end
...
...
ee/spec/migrations/sanitize_tracing_external_url_spec.rb
View file @
406f9df9
...
@@ -13,7 +13,7 @@ describe SanitizeTracingExternalUrl, :migration do
...
@@ -13,7 +13,7 @@ describe SanitizeTracingExternalUrl, :migration do
let
(
:valid_url
)
{
"https://replaceme.com/"
}
let
(
:valid_url
)
{
"https://replaceme.com/"
}
let
(
:invalid_url
)
{
"https://replaceme.com/'><script>alert(document.cookie)</script>"
}
let
(
:invalid_url
)
{
"https://replaceme.com/'><script>alert(document.cookie)</script>"
}
let
(
:cleaned_url
)
{
"https://replaceme.com/'
>
"
}
let
(
:cleaned_url
)
{
"https://replaceme.com/'
>
"
}
before
do
before
do
namespaces
.
create
(
id:
1
,
name:
'gitlab-org'
,
path:
'gitlab-org'
)
namespaces
.
create
(
id:
1
,
name:
'gitlab-org'
,
path:
'gitlab-org'
)
...
...
ee/spec/models/project_tracing_setting_spec.rb
View file @
406f9df9
...
@@ -29,7 +29,7 @@ describe ProjectTracingSetting do
...
@@ -29,7 +29,7 @@ describe ProjectTracingSetting do
it
'sanitizes the url'
do
it
'sanitizes the url'
do
tracing_setting
.
external_url
=
"https://replaceme.com/'><script>alert(document.cookie)</script>"
tracing_setting
.
external_url
=
"https://replaceme.com/'><script>alert(document.cookie)</script>"
expect
(
tracing_setting
).
to
be_valid
expect
(
tracing_setting
).
to
be_valid
expect
(
tracing_setting
.
external_url
).
to
eq
(
"https://replaceme.com/'
>
"
)
expect
(
tracing_setting
.
external_url
).
to
eq
(
"https://replaceme.com/'
>
"
)
end
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