Reviewed by Ken and Maciej.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Mar 2005 17:49:05 +0000 (17:49 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Mar 2005 17:49:05 +0000 (17:49 +0000)
        - fixed <rdar://problem/4049040> REGRESSION (403-405): security check prevents user stylesheet from loading (Dictionary.app doesn't work at all!)

        * kwq/WebCoreBridge.mm: (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Changed to give "applewebdata:"
        documents the same privileges to open local files that "file:" documents have.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8873 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog-2005-08-23
WebCore/kwq/WebCoreBridge.mm

index 320b03f85d916126d2c2ab1aa11b82fcc5d50abc..4a2c41920ed2888e1b935fb94dad6c7274a72e55 100644 (file)
@@ -1,3 +1,12 @@
+2005-03-13  Darin Adler  <darin@apple.com>
+
+        Reviewed by Ken and Maciej.
+
+        - fixed <rdar://problem/4049040> REGRESSION (403-405): security check prevents user stylesheet from loading (Dictionary.app doesn't work at all!)
+
+        * kwq/WebCoreBridge.mm: (-[WebCoreBridge canLoadURL:fromReferrer:hideReferrer:]): Changed to give "applewebdata:"
+        documents the same privileges to open local files that "file:" documents have.
+
 2005-03-13  Kevin Decker  <kdecker@apple.com>
 
         Reviewed by mjs.
index 2da669893d87446671f8a144c417fe5b3d2b2ad9..a03c1a9dfb1beb50762bf99f3b6526e59e289d79 100644 (file)
@@ -388,12 +388,12 @@ static bool initializedKJS = FALSE;
 
 - (BOOL)canLoadURL:(NSURL *)URL fromReferrer:(NSString *)referrer hideReferrer:(BOOL *)hideReferrer
 {
-    *hideReferrer = !hasCaseInsensitivePrefix(referrer,@"http:") && !hasCaseInsensitivePrefix(referrer, @"https:");
-    BOOL referrerIsFileURL = hasCaseInsensitivePrefix(referrer, @"file:");
-
+    BOOL referrerIsWebURL = hasCaseInsensitivePrefix(referrer, @"http:") || hasCaseInsensitivePrefix(referrer, @"https:");
+    BOOL referrerIsLocalURL = hasCaseInsensitivePrefix(referrer, @"file:") || hasCaseInsensitivePrefix(referrer, @"applewebdata:");
     BOOL URLIsFileURL = [[URL scheme] compare:@"file" options:(NSCaseInsensitiveSearch|NSLiteralSearch)] == NSOrderedSame;
 
-    return !URLIsFileURL || referrerIsFileURL;
+    *hideReferrer = !referrerIsWebURL;
+    return !URLIsFileURL || referrerIsLocalURL;
 }
 
 - (void)saveDocumentState