Add protection against malicious code in font loader.
This commit is contained in:
parent
eb4ec7899a
commit
ed2bcf0ffa
@ -494,9 +494,14 @@ var FontLoader = {
|
|||||||
// 82402.
|
// 82402.
|
||||||
|
|
||||||
// Validate the names parameter -- the values can used to construct HTML.
|
// Validate the names parameter -- the values can used to construct HTML.
|
||||||
if (!/^\w+$/.test(names.join('')))
|
if (!/^\w+$/.test(names.join(''))) {
|
||||||
error('Invalid font name(s): ' + names.join());
|
error('Invalid font name(s): ' + names.join());
|
||||||
|
|
||||||
|
// Normally the error-function throws. But if a malicious code
|
||||||
|
// intercepts the function call then the return is needed.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var div = document.createElement('div');
|
var div = document.createElement('div');
|
||||||
div.setAttribute('style',
|
div.setAttribute('style',
|
||||||
'visibility: hidden;' +
|
'visibility: hidden;' +
|
||||||
|
Loading…
Reference in New Issue
Block a user