From c4cd0afca96bb6281ffc5e10bbb8db82a5227784 Mon Sep 17 00:00:00 2001 From: "morse%netscape.com" Date: Sun, 26 Mar 2000 23:36:03 +0000 Subject: [PATCH] implement a better test for determining foreign images --- extensions/cookie/nsCookie.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extensions/cookie/nsCookie.cpp b/extensions/cookie/nsCookie.cpp index 12588fc93c0..1e75ec3c416 100644 --- a/extensions/cookie/nsCookie.cpp +++ b/extensions/cookie/nsCookie.cpp @@ -1066,6 +1066,9 @@ permission_Check } } +PRIVATE int +cookie_SameDomain(char * currentHost, char * firstHost); + PUBLIC nsresult Image_CheckForPermission(char * hostname, char * firstHostname, PRBool &permission) { @@ -1083,7 +1086,8 @@ Image_CheckForPermission(char * hostname, char * firstHostname, PRBool &permissi /* try to make a decision based on pref settings */ if ((image_GetBehaviorPref() == COOKIE_DontUse) || (image_GetBehaviorPref() == COOKIE_DontAcceptForeign && - PL_strcmp(hostname, firstHostname))) { +// PL_strcmp(hostname, firstHostname))) { + !cookie_SameDomain(hostname, firstHostname))) { permission = PR_FALSE; return NS_OK; }