Fixing bug 366082. Prevent Adobe Acrobat from loading URLs other than http:, https:, or ftp: w/o specifying a target. r+sr+a=dveditz@cruzio.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@219080 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1120,6 +1120,21 @@ _geturl(NPP npp, const char* relativeURL, const char* target)
|
||||
("NPN_GetURL: npp=%p, target=%s, url=%s\n", (void *)npp, target,
|
||||
relativeURL));
|
||||
|
||||
// Block Adobe Acrobat from loading URLs that are not http:, https:,
|
||||
// or ftp: URLs if the given target is null.
|
||||
if (target == nsnull && relativeURL &&
|
||||
(strncmp(relativeURL, "http:", 5) != 0) &&
|
||||
(strncmp(relativeURL, "https:", 6) != 0) &&
|
||||
(strncmp(relativeURL, "ftp:", 4) != 0)) {
|
||||
ns4xPluginInstance *inst = (ns4xPluginInstance *) npp->ndata;
|
||||
|
||||
const char *name = nsPluginHostImpl::GetPluginName(inst);
|
||||
|
||||
if (name && strstr(name, "Adobe") && strstr(name, "Acrobat")) {
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
return MakeNew4xStreamInternal (npp, relativeURL, target,
|
||||
eNPPStreamTypeInternal_Get);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user