Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
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
nexedi
converse.js
Commits
fa656935
Commit
fa656935
authored
Feb 19, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't use `_.template` for variable interpolation
It depends on `eval` which is unsafe.
parent
4d34952e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
CHANGES.md
CHANGES.md
+4
-0
src/converse-core.js
src/converse-core.js
+1
-1
src/utils.js
src/utils.js
+8
-0
No files found.
CHANGES.md
View file @
fa656935
# Changelog
## 3.3.4 (Unreleased)
-
Avoid
`eval`
(via
`_.template`
from lodash).
## 3.3.3 (2018-02-14)
### Bugfixes
...
...
src/converse-core.js
View file @
fa656935
...
...
@@ -1862,7 +1862,7 @@
i18n
.
fetchTranslations
(
_converse
.
locale
,
_converse
.
locales
,
_
.
template
(
_converse
.
locales_url
)(
{
'
locale
'
:
_converse
.
locale
}))
u
.
interpolate
(
_converse
.
locales_url
,
{
'
locale
'
:
_converse
.
locale
}))
.
catch
(
_
.
partial
(
_converse
.
log
,
_
,
Strophe
.
LogLevel
.
FATAL
))
.
then
(
finishInitialization
)
.
catch
(
_
.
partial
(
_converse
.
log
,
_
,
Strophe
.
LogLevel
.
FATAL
));
...
...
src/utils.js
View file @
fa656935
...
...
@@ -646,6 +646,14 @@
return
promise
;
};
u
.
interpolate
=
function
(
string
,
o
)
{
return
string
.
replace
(
/{{{
([^
{}
]
*
)
}}}/g
,
(
a
,
b
)
=>
{
var
r
=
o
[
b
];
return
typeof
r
===
'
string
'
||
typeof
r
===
'
number
'
?
r
:
a
;
});
};
u
.
safeSave
=
function
(
model
,
attributes
)
{
if
(
u
.
isPersistableModel
(
model
))
{
model
.
save
(
attributes
);
...
...
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