[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:42:24 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit b65ae9a4d9ed80260aaa48c224ef8f581a441d66
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu May 15 21:46:28 2003 +0000
Fixed: 3155760 - Plug-in MIME and extension mapping should be case-insensitive
Reviewed by john.
* Plugins.subproj/WebBasePluginPackage.m:
(-[WebBasePluginPackage getPluginInfoFromBundleAndMIMEDictionary:]): store the extensions and MIMEs as lowercase strings
(-[NSArray _web_lowercaseStrings]): new, returns array of lowercase strings
* Plugins.subproj/WebNetscapePluginPackage.m:
(-[WebNetscapePluginPackage getPluginInfoFromResources]): store the extensions and MIMEs as lowercase strings
* Plugins.subproj/WebPluginDatabase.m:
(-[WebPluginDatabase pluginForMIMEType:]): lowercase the passed MIME type
(-[WebPluginDatabase pluginForExtension:]): lowercase the passed extension
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4384 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index e401686..268298d 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,18 @@
+2003-05-15 Chris Blumenberg <cblu at apple.com>
+
+ Fixed: 3155760 - Plug-in MIME and extension mapping should be case-insensitive
+
+ Reviewed by john.
+
+ * Plugins.subproj/WebBasePluginPackage.m:
+ (-[WebBasePluginPackage getPluginInfoFromBundleAndMIMEDictionary:]): store the extensions and MIMEs as lowercase strings
+ (-[NSArray _web_lowercaseStrings]): new, returns array of lowercase strings
+ * Plugins.subproj/WebNetscapePluginPackage.m:
+ (-[WebNetscapePluginPackage getPluginInfoFromResources]): store the extensions and MIMEs as lowercase strings
+ * Plugins.subproj/WebPluginDatabase.m:
+ (-[WebPluginDatabase pluginForMIMEType:]): lowercase the passed MIME type
+ (-[WebPluginDatabase pluginForExtension:]): lowercase the passed extension
+
=== Safari-79 ===
2003-05-15 Ken Kocienda <kocienda at apple.com>
diff --git a/WebKit/Plugins.subproj/WebBasePluginPackage.m b/WebKit/Plugins.subproj/WebBasePluginPackage.m
index 0ae4123..a913888 100644
--- a/WebKit/Plugins.subproj/WebBasePluginPackage.m
+++ b/WebKit/Plugins.subproj/WebBasePluginPackage.m
@@ -12,6 +12,10 @@
#import <WebKit/WebPluginPackage.h>
+ at interface NSArray (WebPluginExtensions)
+- (NSArray *)_web_lowercaseStrings;
+ at end;
+
@implementation WebBasePluginPackage
+ (WebBasePluginPackage *)pluginWithPath:(NSString *)pluginPath
@@ -84,18 +88,20 @@
while ((MIME = [keyEnumerator nextObject]) != nil) {
MIMEDictionary = [MIMETypes objectForKey:MIME];
-
+
// FIXME: Consider storing disabled MIME types.
NSNumber *isEnabled = [MIMEDictionary objectForKey:WebPluginTypeEnabledKey];
if (isEnabled && [isEnabled boolValue] == NO) {
continue;
}
- extensions = [MIMEDictionary objectForKey:WebPluginExtensionsKey];
- if (!extensions) {
+ extensions = [[MIMEDictionary objectForKey:WebPluginExtensionsKey] _web_lowercaseStrings];
+ if ([extensions count] == 0) {
extensions = [NSArray arrayWithObject:@""];
}
+ MIME = [MIME lowercaseString];
+
[MIMEToExtensionsDictionary setObject:extensions forKey:MIME];
description = [MIMEDictionary objectForKey:WebPluginTypeDescriptionKey];
@@ -260,3 +266,22 @@
}
@end
+
+ at implementation NSArray (WebPluginExtensions)
+
+- (NSArray *)_web_lowercaseStrings
+{
+ NSMutableArray *lowercaseStrings = [NSMutableArray arrayWithCapacity:[self count]];
+ NSEnumerator *strings = [self objectEnumerator];
+ NSString *string;
+
+ while ((string = [strings nextObject]) != nil) {
+ if ([string isKindOfClass:[NSString class]]) {
+ [lowercaseStrings addObject:[string lowercaseString]];
+ }
+ }
+
+ return lowercaseStrings;
+}
+
+ at end;
diff --git a/WebKit/Plugins.subproj/WebNetscapePluginPackage.m b/WebKit/Plugins.subproj/WebNetscapePluginPackage.m
index 22ffba7..956e1b6 100644
--- a/WebKit/Plugins.subproj/WebNetscapePluginPackage.m
+++ b/WebKit/Plugins.subproj/WebNetscapePluginPackage.m
@@ -16,6 +16,10 @@ typedef void (* TransitionVector) (void);
static FunctionPointer functionPointerForTVector(TransitionVector);
static TransitionVector tVectorForFunctionPointer(FunctionPointer);
+#define PluginNameOrDescriptionStringNumber 126
+#define MIMEDescriptionStringNumber 127
+#define MIMEListStringStringNumber 128
+
@implementation WebNetscapePluginPackage
+ (void)initialize
@@ -108,7 +112,8 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
NSMutableDictionary *MIMEToDescriptionDictionary = [NSMutableDictionary dictionary];
for (i=1; 1; i+=2) {
- MIME = [self stringForStringListID:128 andIndex:i];
+ MIME = [[self stringForStringListID:MIMEListStringStringNumber
+ andIndex:i] lowercaseString];
if (!MIME) {
break;
}
@@ -119,7 +124,8 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
continue;
}
- extensionsList = [self stringForStringListID:128 andIndex:i+1];
+ extensionsList = [[self stringForStringListID:MIMEListStringStringNumber
+ andIndex:i+1] lowercaseString];
if (extensionsList) {
extensions = [extensionsList componentsSeparatedByString:@","];
[MIMEToExtensionsDictionary setObject:extensions forKey:MIME];
@@ -128,7 +134,8 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
[MIMEToExtensionsDictionary setObject:[NSArray arrayWithObject:@""] forKey:MIME];
}
- description = [self stringForStringListID:127 andIndex:[MIMEToExtensionsDictionary count]];
+ description = [self stringForStringListID:MIMEDescriptionStringNumber
+ andIndex:[MIMEToExtensionsDictionary count]];
if (description) {
[MIMEToDescriptionDictionary setObject:description forKey:MIME];
} else {
@@ -155,14 +162,14 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
NSString *filename = [self filename];
- description = [self stringForStringListID:126 andIndex:1];
+ description = [self stringForStringListID:PluginNameOrDescriptionStringNumber andIndex:1];
if (!description) {
description = filename;
}
[self setPluginDescription:description];
- NSString *theName = [self stringForStringListID:126 andIndex:2];
+ NSString *theName = [self stringForStringListID:PluginNameOrDescriptionStringNumber andIndex:2];
if (!theName) {
theName = filename;
}
diff --git a/WebKit/Plugins.subproj/WebPluginDatabase.m b/WebKit/Plugins.subproj/WebPluginDatabase.m
index 13554d0..9432031 100644
--- a/WebKit/Plugins.subproj/WebPluginDatabase.m
+++ b/WebKit/Plugins.subproj/WebPluginDatabase.m
@@ -73,12 +73,14 @@ static WebPluginDatabase *database = nil;
- (WebBasePluginPackage *)pluginForMIMEType:(NSString *)MIMEType
{
- return [self pluginForKey:MIMEType withEnumeratorSelector:@selector(MIMETypeEnumerator)];
+ return [self pluginForKey:[MIMEType lowercaseString]
+ withEnumeratorSelector:@selector(MIMETypeEnumerator)];
}
- (WebBasePluginPackage *)pluginForExtension:(NSString *)extension
{
- return [self pluginForKey:extension withEnumeratorSelector:@selector(extensionEnumerator)];
+ return [self pluginForKey:[extension lowercaseString]
+ withEnumeratorSelector:@selector(extensionEnumerator)];
}
- (WebBasePluginPackage *)pluginForFilename:(NSString *)filename
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list