[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
cblu
cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:15:58 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit b22935c6cd64ed62afd9e6a2793c5c534156d2d5
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Dec 17 21:58:18 2002 +0000
WebFoundation:
Fixed: 3113073 - link on http://studio.adobe.com/explore/ redirects to not found page in Alex
Reviewed by darin.
* Misc.subproj/WebNSStringExtras.m:
(-[NSString _web_looksLikeAbsoluteURL]): trim whitespace because _web_URLWithString allows whitespace
* Misc.subproj/WebNSURLExtras.m:
(+[NSURL _web_URLWithString:]): trim whitespace because we shouldn't replace spaces with escape characters
(+[NSURL _web_URLWithString:relativeToURL:]): trim whitespace because we shouldn't replace spaces with escape characters
WebKit:
Fixed: 3113073 - link on http://studio.adobe.com/explore/ redirects to not found page in Alex
Reviewed by darin.
* Misc.subproj/WebNSPasteboardExtras.m:
(-[NSPasteboard _web_bestURL]): don't trim whitespace because _web_URLWithString does this for us
* Plugins.subproj/WebBaseNetscapePluginView.m:
(-[WebBaseNetscapePluginView pluginURLFromCString:]): tweak
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3103 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index cc14f74..3b28e96 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,14 @@
+2002-12-17 Chris Blumenberg <cblu at apple.com>
+
+ Fixed: 3113073 - link on http://studio.adobe.com/explore/ redirects to not found page in Alex
+
+ Reviewed by darin.
+
+ * Misc.subproj/WebNSPasteboardExtras.m:
+ (-[NSPasteboard _web_bestURL]): don't trim whitespace because _web_URLWithString does this for us
+ * Plugins.subproj/WebBaseNetscapePluginView.m:
+ (-[WebBaseNetscapePluginView pluginURLFromCString:]): tweak
+
2002-12-17 John Sullivan <sullivan at apple.com>
- to help with performance of various bookmark operations,
diff --git a/WebKit/Misc.subproj/WebNSPasteboardExtras.m b/WebKit/Misc.subproj/WebNSPasteboardExtras.m
index 22063bd..b37127d 100644
--- a/WebKit/Misc.subproj/WebNSPasteboardExtras.m
+++ b/WebKit/Misc.subproj/WebNSPasteboardExtras.m
@@ -51,9 +51,12 @@ NSString *WebURLNamePboardType = nil;
}
if ([types containsObject:NSStringPboardType]) {
- NSString *URLString = [[self stringForType:NSStringPboardType] _web_stringByTrimmingWhitespace];
+ NSString *URLString = [self stringForType:NSStringPboardType];
if ([URLString _web_looksLikeAbsoluteURL]) {
- return [[NSURL _web_URLWithString:URLString] _web_canonicalize];
+ NSURL *URL = [[NSURL _web_URLWithString:URLString] _web_canonicalize];
+ if (URL) {
+ return URL;
+ }
}
}
diff --git a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
index 6d5bc4f..2eeedd6 100644
--- a/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
+++ b/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
@@ -794,32 +794,38 @@
@implementation WebBaseNetscapePluginView (WebNPPCallbacks)
-- (NSURL *)pluginURLFromCString:(const char *)URLCString
+- (WebResourceRequest *)requestWithURLCString:(const char *)URLCString
{
- NSString *URLString;
+ if (!URLCString) {
+ return nil;
+ }
+
+ NSString *URLString = (NSString *)CFStringCreateWithCString(kCFAllocatorDefault, URLCString, kCFStringEncodingWindowsLatin1);
NSURL *URL;
-
- URLString = [NSString stringWithCString:URLCString];
-
+
if ([URLString _web_looksLikeAbsoluteURL]) {
URL = [NSURL _web_URLWithString:URLString];
- }
- else {
+ } else {
URL = [NSURL _web_URLWithString:URLString relativeToURL:baseURL];
}
+
+ [URLString release];
+
+ if (!URL) {
+ return nil;
+ }
- return URL;
+ return [[[WebResourceRequest alloc] initWithURL:URL] autorelease];
}
-- (NPError)loadRequest:(WebResourceRequest *)request inTarget:(NSString *)target withNotifyData:(void *)notifyData
+- (NPError)loadRequest:(WebResourceRequest *)request inTarget:(const char *)cTarget withNotifyData:(void *)notifyData
{
NSURL *URL = [request URL];
-
if (!URL) {
return NPERR_INVALID_URL;
}
- if (!target) {
+ if (!cTarget) {
WebNetscapePluginStream *stream = [[WebNetscapePluginStream alloc] initWithRequest:request
pluginPointer:instance
notifyData:notifyData];
@@ -838,6 +844,7 @@
NPP_URLNotify(instance, [[URL absoluteString] cString], NPRES_DONE, notifyData);
}
}else{
+ NSString *target = (NSString *)CFStringCreateWithCString(kCFAllocatorDefault, cTarget, kCFStringEncodingWindowsLatin1);
WebFrame *frame = [[self webFrame] findOrCreateFramedNamed:target];
[frame loadRequest:request];
@@ -851,114 +858,82 @@
name:WebFrameStateChangedNotification
object:frame];
}
+
}
+ [target release];
}
}
return NPERR_NO_ERROR;
}
--(NPError)getURLNotify:(const char *)URL target:(const char *)target notifyData:(void *)notifyData
+-(NPError)getURLNotify:(const char *)URLCString target:(const char *)cTarget notifyData:(void *)notifyData
{
- NSString *theTarget = nil;
- NSURL *pluginURL;
- WebResourceRequest *request;
-
- LOG(Plugins, "NPN_GetURLNotify: %s target: %s", URL, target);
-
- if(!URL)
- return NPERR_INVALID_URL;
-
- if(target)
- theTarget = [NSString stringWithCString:target];
-
- pluginURL = [self pluginURLFromCString:URL];
-
- if(!pluginURL)
- return NPERR_INVALID_URL;
-
- request = [[[WebResourceRequest alloc] initWithURL:pluginURL] autorelease];
-
- return [self loadRequest:request inTarget:theTarget withNotifyData:notifyData];
+ WebResourceRequest *request = [self requestWithURLCString:URLCString];
+ return [self loadRequest:request inTarget:cTarget withNotifyData:notifyData];
}
--(NPError)getURL:(const char *)URL target:(const char *)target
+-(NPError)getURL:(const char *)URLCString target:(const char *)cTarget
{
- NSString *theTarget = nil;
- NSURL *pluginURL;
- WebResourceRequest *request;
-
- LOG(Plugins, "NPN_GetURL: %s target: %s", URL, target);
-
- if(!URL)
- return NPERR_INVALID_URL;
-
- if(target)
- theTarget = [NSString stringWithCString:target];
-
- pluginURL = [self pluginURLFromCString:URL];
+ LOG(Plugins, "NPN_GetURL: %s target: %s", URLCString, cTarget);
- if(!pluginURL)
- return NPERR_INVALID_URL;
-
- request = [[[WebResourceRequest alloc] initWithURL:pluginURL] autorelease];
-
- return [self loadRequest:request inTarget:theTarget withNotifyData:NULL];
+ WebResourceRequest *request = [self requestWithURLCString:URLCString];
+ return [self loadRequest:request inTarget:cTarget withNotifyData:NULL];
}
--(NPError)postURLNotify:(const char *)URL target:(const char *)target len:(UInt32)len buf:(const char *)buf file:(NPBool)file notifyData:(void *)notifyData
+-(NPError)postURLNotify:(const char *)URLCString
+ target:(const char *)cTarget
+ len:(UInt32)len
+ buf:(const char *)buf
+ file:(NPBool)file
+ notifyData:(void *)notifyData
{
- NSData *postData;
- NSURL *tempURL;
- NSString *path, *theTarget = nil;
- NSURL *pluginURL;
- WebResourceRequest *request;
+ LOG(Plugins, "NPN_PostURLNotify: %s", URLCString);
+
+ if (!len || !buf) {
+ return NPERR_INVALID_PARAM;
+ }
- LOG(Plugins, "NPN_PostURLNotify: %s", URL);
-
- if(!URL)
- return NPERR_INVALID_URL;
-
- if(target)
- theTarget = [NSString stringWithCString:target];
-
- if(file){
- if([[NSString stringWithCString:buf] _web_looksLikeAbsoluteURL]){
- tempURL = [NSURL fileURLWithPath:[NSString stringWithCString:URL]];
- path = [tempURL path];
- }else{
- path = [NSString stringWithCString:buf];
+ NSData *postData = nil;
+
+ if (file) {
+ // If we're posting a file, buf is either a file URL or a path string of the file.
+ NSString *bufString = (NSString *)CFStringCreateWithCString(kCFAllocatorDefault, buf, kCFStringEncodingWindowsLatin1);
+ NSURL *fileURL = [NSURL _web_URLWithString:bufString];
+ NSString *path;
+ if ([fileURL isFileURL]) {
+ path = [fileURL path];
+ } else {
+ path = bufString;
}
postData = [NSData dataWithContentsOfFile:path];
- }else{
+ [bufString release];
+ if (!postData) {
+ return NPERR_FILE_NOT_FOUND;
+ }
+ } else {
postData = [NSData dataWithBytes:buf length:len];
}
- pluginURL = [self pluginURLFromCString:URL];
+ if (!postData) {
+ return NPERR_INVALID_PARAM;
+ }
- if(!pluginURL)
- return NPERR_INVALID_URL;
-
- request = [[[WebResourceRequest alloc] initWithURL:pluginURL] autorelease];
+ WebResourceRequest *request = [self requestWithURLCString:URLCString];
[request setMethod:@"POST"];
[request setData:postData];
- return [self loadRequest:request inTarget:theTarget withNotifyData:notifyData];
+ return [self loadRequest:request inTarget:cTarget withNotifyData:notifyData];
}
--(NPError)postURL:(const char *)URL target:(const char *)target len:(UInt32)len buf:(const char *)buf file:(NPBool)file
+-(NPError)postURL:(const char *)URLCString
+ target:(const char *)target
+ len:(UInt32)len
+ buf:(const char *)buf
+ file:(NPBool)file
{
- NSString *theTarget = nil;
-
- LOG(Plugins, "NPN_PostURL: %s", URL);
-
- if(!URL)
- return NPERR_INVALID_URL;
-
- if(target)
- theTarget = [NSString stringWithCString:target];
-
- return [self postURLNotify:URL target:target len:len buf:buf file:file notifyData:NULL];
+ LOG(Plugins, "NPN_PostURL: %s", URLCString);
+ return [self postURLNotify:URLCString target:target len:len buf:buf file:file notifyData:NULL];
}
-(NPError)newStream:(NPMIMEType)type target:(const char *)target stream:(NPStream**)stream
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list