зеркало из https://github.com/mozilla/pjs.git
Make sure we lowercase types/extensions before putting them in the
datasource and that we lowercase types/extensions before comparing to the datasource. Bug 114462, r=law, sr=mscott.
This commit is contained in:
Родитель
daecc5269f
Коммит
db1df595a8
|
@ -25,9 +25,9 @@ HandlerOverride.prototype = {
|
|||
set mimeType(aMIMETypeString)
|
||||
{
|
||||
if (!this.mUpdateMode)
|
||||
assertMIMEStuff(MIME_URI(aMIMETypeString), "value", aMIMETypeString);
|
||||
assertMIMEStuff(MIME_URI(aMIMETypeString), "value", aMIMETypeString.toLowerCase());
|
||||
else
|
||||
changeMIMEStuff(MIME_URI(aMIMETypeString), "value", aMIMETypeString);
|
||||
changeMIMEStuff(MIME_URI(aMIMETypeString), "value", aMIMETypeString.toLowerCase());
|
||||
},
|
||||
|
||||
get description()
|
||||
|
@ -100,7 +100,7 @@ HandlerOverride.prototype = {
|
|||
var currentExtension = extensionTargets.getNext();
|
||||
if (currentExtension) {
|
||||
currentExtension = currentExtension.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
extString += currentExtension.Value.toUpperCase() + " ";
|
||||
extString += currentExtension.Value.toLowerCase() + " ";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -109,12 +109,12 @@ HandlerOverride.prototype = {
|
|||
|
||||
addExtension: function (aExtensionString)
|
||||
{
|
||||
assertMIMEStuff(MIME_URI(this.mimeType), "fileExtensions", aExtensionString);
|
||||
assertMIMEStuff(MIME_URI(this.mimeType), "fileExtensions", aExtensionString.toLowerCase());
|
||||
},
|
||||
|
||||
removeExtension: function (aExtensionString)
|
||||
{
|
||||
unassertMIMEStuff(MIME_URI(this.mimeType), "fileExtensions", aExtensionString);
|
||||
unassertMIMEStuff(MIME_URI(this.mimeType), "fileExtensions", aExtensionString.toLowerCase());
|
||||
},
|
||||
|
||||
// content handling
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
var info = window.arguments[0].mLauncher.MIMEInfo;
|
||||
|
||||
// Get mime type from which we can construct a HandlerInfo...
|
||||
var mimeType = info.MIMEType;
|
||||
var mimeType = info.MIMEType.toLowerCase();
|
||||
|
||||
// Construct what we need from mime type URI.
|
||||
getDS();
|
||||
|
@ -193,6 +193,7 @@
|
|||
return false;
|
||||
}
|
||||
getDS();
|
||||
gMIMEField.value = gMIMEField.value.toLowerCase();
|
||||
// figure out if this mime type already exists.
|
||||
if (gMIMEField.value != gOldMIME) {
|
||||
var exists = mimeHandlerExists(gMIMEField.value);
|
||||
|
@ -222,7 +223,7 @@
|
|||
// set description, editable, and extensions
|
||||
handlerInfo.description = gOldDesc
|
||||
handlerInfo.isEditable = true;
|
||||
var extensions = gOldExtensions.split(" ");
|
||||
var extensions = gOldExtensions.toLowerCase().split(" ");
|
||||
for (var i = 0; i < extensions.length; i++) {
|
||||
var currExtension = extensions[i];
|
||||
handlerInfo.addExtension(currExtension);
|
||||
|
|
Загрузка…
Ссылка в новой задаче