Moving closing paren to make it clearer what the logic really is and removing redundant comment. No behavior change.
Moving closing paren to make it clearer what the logic really is and removing redundant comment. No behavior change.
--- a/browser/components/feeds/src/nsFeedSniffer.cpp
+++ b/browser/components/feeds/src/nsFeedSniffer.cpp
@@ -156,27 +156,24 @@ HasAttachmentDisposition(nsIHttpChannel*
// Get the disposition type
rv = mimehdrpar->GetParameter(contentDisposition, "", fallbackCharset,
PR_TRUE, nsnull, dispToken);
// RFC 2183, section 2.8 says that an unknown disposition
// value should be treated as "attachment"
// XXXbz this code is duplicated in GetFilenameAndExtensionFromChannel in
// nsExternalHelperAppService. Factor it out!
if (NS_FAILED(rv) ||
- (// Some broken sites just send
- // Content-Disposition: ; filename="file"
- // screen those out here.
- !dispToken.IsEmpty() &&
+ (!dispToken.IsEmpty() &&
!StringBeginsWithLowercaseLiteral(dispToken, "inline") &&
// Broken sites just send
// Content-Disposition: filename="file"
// without a disposition token... screen those out.
- !StringBeginsWithLowercaseLiteral(dispToken, "filename")) &&
- // Also in use is Content-Disposition: name="file"
- !StringBeginsWithLowercaseLiteral(dispToken, "name"))
+ !StringBeginsWithLowercaseLiteral(dispToken, "filename") &&
+ // Also in use is Content-Disposition: name="file"
+ !StringBeginsWithLowercaseLiteral(dispToken, "name")))
// We have a content-disposition of "attachment" or unknown
return PR_TRUE;
}
}
return PR_FALSE;
}
--- a/uriloader/base/nsURILoader.cpp
+++ b/uriloader/base/nsURILoader.cpp
@@ -397,27 +397,24 @@ nsresult nsDocumentOpenInfo::DispatchCon
// Get the disposition type
rv = mimehdrpar->GetParameter(disposition, "", fallbackCharset,
PR_TRUE, nsnull, dispToken);
// RFC 2183, section 2.8 says that an unknown disposition
// value should be treated as "attachment"
// XXXbz this code is duplicated in GetFilenameAndExtensionFromChannel in
// nsExternalHelperAppService. Factor it out!
if (NS_FAILED(rv) ||
- (// Some broken sites just send
- // Content-Disposition: ; filename="file"
- // screen those out here.
- !dispToken.IsEmpty() &&
+ (!dispToken.IsEmpty() &&
!dispToken.LowerCaseEqualsLiteral("inline") &&
- // Broken sites just send
- // Content-Disposition: filename="file"
- // without a disposition token... screen those out.
- !dispToken.EqualsIgnoreCase("filename", 8)) &&
- // Also in use is Content-Disposition: name="file"
- !dispToken.EqualsIgnoreCase("name", 4))
+ // Broken sites just send
+ // Content-Disposition: filename="file"
+ // without a disposition token... screen those out.
+ !dispToken.EqualsIgnoreCase("filename", 8) &&
+ // Also in use is Content-Disposition: name="file"
+ !dispToken.EqualsIgnoreCase("name", 4)))
// We have a content-disposition of "attachment" or unknown
forceExternalHandling = PR_TRUE;
}
}
LOG((" forceExternalHandling: %s", forceExternalHandling ? "yes" : "no"));
// We're going to try to find a contentListener that can handle our data
--- a/uriloader/exthandler/nsExternalHelperAppService.cpp
+++ b/uriloader/exthandler/nsExternalHelperAppService.cpp
@@ -311,27 +311,24 @@ static PRBool GetFilenameAndExtensionFro
nsAutoString dispToken;
rv = mimehdrpar->GetParameter(disp, "", fallbackCharset, PR_TRUE,
nsnull, dispToken);
// RFC 2183, section 2.8 says that an unknown disposition
// value should be treated as "attachment"
// XXXbz this code is duplicated in nsDocumentOpenInfo::DispatchContent.
// Factor it out! Maybe store it in the nsDocumentOpenInfo?
if (NS_FAILED(rv) ||
- (// Some broken sites just send
- // Content-Disposition: ; filename="file"
- // screen those out here.
- !dispToken.IsEmpty() &&
+ (!dispToken.IsEmpty() &&
!dispToken.LowerCaseEqualsLiteral("inline") &&
- // Broken sites just send
- // Content-Disposition: filename="file"
- // without a disposition token... screen those out.
- !dispToken.EqualsIgnoreCase("filename", 8)) &&
- // Also in use is Content-Disposition: name="file"
- !dispToken.EqualsIgnoreCase("name", 4))
+ // Broken sites just send
+ // Content-Disposition: filename="file"
+ // without a disposition token... screen those out.
+ !dispToken.EqualsIgnoreCase("filename", 8) &&
+ // Also in use is Content-Disposition: name="file"
+ !dispToken.EqualsIgnoreCase("name", 4)))
{
// We have a content-disposition of "attachment" or unknown
handleExternally = PR_TRUE;
}
// We may not have a disposition type listed; some servers suck.
// But they could have listed a filename anyway.
GetFilenameFromDisposition(aFileName, disp, uri, mimehdrpar);