Fix bug 51266, allow cookie blocking for local files and the about: protocol. r=morse a=morse

This commit is contained in:
BlakeR1234%aol.com 2000-09-09 05:20:09 +00:00
Родитель 1b5dad648c
Коммит 72652578a0
1 изменённых файлов: 9 добавлений и 6 удалений

Просмотреть файл

@ -868,6 +868,7 @@ permission_Check(
hostname++; hostname++;
} }
StrAllocCopy(hostname2, hostname); StrAllocCopy(hostname2, hostname);
Recycle(hostname);
permission_Add(hostname2, permission, type, PR_TRUE); permission_Add(hostname2, permission, type, PR_TRUE);
} }
if (rememberChecked != permission_GetRememberChecked(type)) { if (rememberChecked != permission_GetRememberChecked(type)) {
@ -2529,9 +2530,10 @@ Image_Block(nsString imageURL) {
char * imageURLCString = imageURL.ToNewCString(); char * imageURLCString = imageURL.ToNewCString();
char *host = cookie_ParseURL(imageURLCString, GET_HOST_PART); char *host = cookie_ParseURL(imageURLCString, GET_HOST_PART);
Recycle(imageURLCString); Recycle(imageURLCString);
if (PL_strlen(host) != 0) { char * hostname = nsnull;
permission_Add(host, PR_FALSE, IMAGEPERMISSION, PR_TRUE); StrAllocCopy(hostname, host);
} Recycle(host);
permission_Add(hostname, PR_FALSE, IMAGEPERMISSION, PR_TRUE);
} }
PUBLIC void PUBLIC void
@ -2542,9 +2544,10 @@ Permission_Add(nsString imageURL, PRBool permission, PRInt32 type) {
char * imageURLCString = imageURL.ToNewCString(); char * imageURLCString = imageURL.ToNewCString();
char *host = cookie_ParseURL(imageURLCString, GET_HOST_PART); char *host = cookie_ParseURL(imageURLCString, GET_HOST_PART);
Recycle(imageURLCString); Recycle(imageURLCString);
if (PL_strlen(host) != 0) { char * hostname = nsnull;
permission_Add(host, permission, type, PR_TRUE); StrAllocCopy(hostname, host);
} Recycle(host);
permission_Add(hostname, permission, type, PR_TRUE);
} }
MODULE_PRIVATE time_t MODULE_PRIVATE time_t