зеркало из https://github.com/mozilla/pjs.git
further fix for 191460, r=bzbarsky, sr=mscott, don't do forced reverse lookups on file extensions even if we have content type
This commit is contained in:
Родитель
038994320d
Коммит
4e09867677
|
@ -193,7 +193,6 @@ pref("mailnews.offline_sync_news", false);
|
|||
pref("mailnews.offline_sync_send_unsent", true);
|
||||
pref("mailnews.offline_sync_work_offline", false);
|
||||
pref("mailnews.force_ascii_search", false);
|
||||
pref("mailnews.autolookup_unknown_mime_types", true);
|
||||
|
||||
pref("mailnews.send_default_charset", "chrome://messenger/locale/messenger.properties");
|
||||
pref("mailnews.view_default_charset", "chrome://messenger/locale/messenger.properties");
|
||||
|
|
|
@ -772,27 +772,13 @@ mime_create (const char *content_type, MimeHeaders *hdrs,
|
|||
char *content_disposition = 0;
|
||||
MimeObject *obj = 0;
|
||||
char *override_content_type = 0;
|
||||
static PRBool reverse_lookup = PR_FALSE, got_lookup_pref = PR_FALSE;
|
||||
|
||||
if (!got_lookup_pref)
|
||||
{
|
||||
nsIPref *pref = GetPrefServiceManager(opts); // Pref service manager
|
||||
if (pref)
|
||||
{
|
||||
pref->GetBoolPref("mailnews.autolookup_unknown_mime_types",&reverse_lookup);
|
||||
got_lookup_pref = PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* There are some clients send out all attachments with a content-type
|
||||
of application/octet-stream. So, if we have an octet-stream attachment,
|
||||
try to guess what type it really is based on the file extension. I HATE
|
||||
that we have to do this...
|
||||
|
||||
If the preference "mailnews.autolookup_unknown_mime_types" is set to PR_TRUE,
|
||||
then we try to do this EVERY TIME when we do not have an entry for the given
|
||||
MIME type in our table, not only when it's application/octet-stream. */
|
||||
*/
|
||||
if (hdrs && opts && opts->file_type_fn &&
|
||||
|
||||
/* ### mwelch - don't override AppleSingle */
|
||||
|
@ -801,13 +787,7 @@ mime_create (const char *content_type, MimeHeaders *hdrs,
|
|||
(content_type ? nsCRT::strcasecmp(content_type, MULTIPART_APPLEDOUBLE) : PR_TRUE) &&
|
||||
(!content_type ||
|
||||
!nsCRT::strcasecmp(content_type, APPLICATION_OCTET_STREAM) ||
|
||||
!nsCRT::strcasecmp(content_type, UNKNOWN_CONTENT_TYPE) ||
|
||||
(reverse_lookup
|
||||
#if 0
|
||||
&& !NET_cinfo_find_info_by_type((char*)content_type))))
|
||||
#else
|
||||
)))
|
||||
#endif
|
||||
!nsCRT::strcasecmp(content_type, UNKNOWN_CONTENT_TYPE)))
|
||||
{
|
||||
char *name = MimeHeaders_get_name(hdrs, opts);
|
||||
if (name)
|
||||
|
|
Загрузка…
Ссылка в новой задаче