Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RocketChat
Rocket.Chat
Commits
bd6b4ecc
Commit
bd6b4ecc
authored
7 years ago
by
Rodrigo Nascimento
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #7121 from RocketChat/xss-image
[FIX] fix bug in preview image
parents
6be835a5
15a971fd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/rocketchat-ui/client/views/app/photoswipe.js
+2
-2
2 additions, 2 deletions
packages/rocketchat-ui/client/views/app/photoswipe.js
with
2 additions
and
2 deletions
packages/rocketchat-ui/client/views/app/photoswipe.js
+
2
−
2
View file @
bd6b4ecc
...
...
@@ -2,12 +2,12 @@ import PhotoSwipe from 'photoswipe';
import
PhotoSwipeUI_Default
from
'
photoswipe/dist/photoswipe-ui-default
'
;
import
'
photoswipe/dist/photoswipe.css
'
;
const
escapeHTML
=
(
html
)
=>
html
.
replace
(
/&/g
,
'
&
'
).
replace
(
/</g
,
'
<
'
).
replace
(
/>/g
,
'
>
'
);
Meteor
.
startup
(()
=>
{
const
initGallery
=
(
selector
,
items
,
options
)
=>
{
const
gallery
=
new
PhotoSwipe
(
selector
,
PhotoSwipeUI_Default
,
items
,
options
);
gallery
.
init
();
};
const
getItems
=
(
selector
,
imageSrc
)
=>
{
const
results
=
{
index
:
0
,
...
...
@@ -44,7 +44,7 @@ Meteor.startup(() => {
galleryOptions
.
index
=
images
.
index
;
galleryOptions
.
addCaptionHTMLFn
=
function
(
item
,
captionEl
)
{
captionEl
.
children
[
0
].
innerHTML
=
`
${
item
.
title
}
<br/><small>
${
item
.
description
}
</small> `
;
captionEl
.
children
[
0
].
innerHTML
=
`
${
escapeHTML
(
item
.
title
)
}
<br/><small>
${
escapeHTML
(
item
.
description
)
}
</small> `
;
return
true
;
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment