Verify the names parameter

This commit is contained in:
notmasteryet 2012-03-15 21:25:19 -05:00
parent 6051720ecb
commit 2508d2c12b

View File

@ -500,6 +500,12 @@ var FontLoader = {
// The postMessage() hackery was added to work around chrome bug
// 82402.
// Validate the names parameter -- the values can used to construct HTML.
if (!/^\w+$/.test(names.join(''))) {
error('Invalid font name(s): ' + names.join());
return; // Keep the return in case if error() did not throw.
}
var div = document.createElement('div');
div.setAttribute('style',
'visibility: hidden;' +