Avoid script injection unless the JS engine is inferred to be Firefox's.

Former-commit-id: 1e267374fe85a858197609b35b85670394c0b66d
This commit is contained in:
John-David Dalton
2012-12-01 00:40:54 -08:00
parent e7f5ebf912
commit 2edb11376d
5 changed files with 164 additions and 163 deletions

View File

@@ -646,7 +646,7 @@
*/
function removeCreateFunction(source) {
return removeFunction(source, 'createFunction')
.replace(/\n *try *{\s*createFunction[\s\S]+?catch[^}]+}\n/, '');
.replace(/\n *try *{(?:\s*\/\/.*)*\n.*?createFunction[\s\S]+?catch[^}]+}\n/, '');
}
/**