зеркало из https://github.com/mozilla/pjs.git
Fixing bug 250862. Prevent javascript: and data: URLs from being dropped into the content area. r=caillon@gmail.com, sr=dveditz@cruzio.com
This commit is contained in:
Родитель
c9262a64a9
Коммит
aa4ea96397
|
@ -4132,8 +4132,11 @@ var contentAreaDNDObserver = {
|
|||
{
|
||||
var url = transferUtils.retrieveURLFromData(aXferData.data, aXferData.flavour.contentType);
|
||||
|
||||
// valid urls don't contain spaces ' '; if we have a space it isn't a valid url so bail out
|
||||
if (!url || !url.length || url.indexOf(" ", 0) != -1)
|
||||
// valid urls don't contain spaces ' '; if we have a space it
|
||||
// isn't a valid url, or if it's a javascript: or data: url,
|
||||
// bail out
|
||||
if (!url || !url.length || url.indexOf(" ", 0) != -1 ||
|
||||
/^\s*(javascript|data):/.test(url))
|
||||
return;
|
||||
|
||||
switch (document.firstChild.getAttribute('windowtype')) {
|
||||
|
|
|
@ -53,8 +53,11 @@ var contentAreaDNDObserver = {
|
|||
{
|
||||
var url = transferUtils.retrieveURLFromData(aXferData.data, aXferData.flavour.contentType);
|
||||
|
||||
// valid urls don't contain spaces ' '; if we have a space it isn't a valid url so bail out
|
||||
if (!url || !url.length || url.indexOf(" ", 0) != -1)
|
||||
// valid urls don't contain spaces ' '; if we have a space it
|
||||
// isn't a valid url, or if it's a javascript: or data: url,
|
||||
// bail out
|
||||
if (!url || !url.length || url.indexOf(" ", 0) != -1 ||
|
||||
/^\s*(javascript|data):/.test(url))
|
||||
return;
|
||||
|
||||
switch (document.firstChild.getAttribute('windowtype')) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче