Bug 1402896 - make the url bar strip javascript even when preceded by control characters, r=mak

MozReview-Commit-ID: 5ZO8n5lfvnl
This commit is contained in:
Gijs Kruitbosch
2017-09-25 17:24:26 +01:00
parent cb194e85c7
commit 2551fe9c17
2 changed files with 2 additions and 1 deletions

View File

@@ -6126,7 +6126,7 @@ function stripUnsafeProtocolOnPaste(pasteData) {
// LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL for those.
let changed = false;
let pasteDataNoJS = pasteData.replace(/\r?\n/g, "")
.replace(/^(?:\s*javascript:)+/i,
.replace(/^(?:\W*javascript:)+/i,
() => {
changed = true;
return "";