Ticket #1485141 (closed Bugs: fixed)

Opened 6 months ago

Last modified 4 months ago

SVN 1555 - Attachment handling completely broken due to RFC822/jpeg fix

Reported by: rosali Owned by:
Priority: 5 Milestone: 0.2-beta
Component: PHP backend Version: 0.2-alpha
Severity: normal Keywords:
Cc:

Description

Changelog 16/06/2008 ...

It seems the fix has broken the whole attachment handling. I get JS Error '}' expected on Line 56 followed by "Can't load page ..." (IE7) on preview and message page.

Also I see a invalid link to the attachment in the f.e. -->UTF-8"Beispiel.jpg<--

All mime types - not only .msg, .eml, .jpeg ... - are affected!

-Roland

Change History

in reply to: ↑ description   Changed 6 months ago by rosali

Replying to rosali:

Update:

Header is mal-formatted:

Content-Transfer-Encoding: base64 Content-Type: ; name*="UTF-8Beispiel.jpg"; Content-Disposition: attachment; filename*="UTF-8Beispiel.jpg";

  Changed 6 months ago by rosali

Found the bug myself. The culprit is in function rc_mime_content_type (rcube_shared.inc).

Comment out ...

//if (function_exists('mime_content_type')) { // return mime_content_type($path); //}

... or pass the filename to mime_content_type!

You can't use mime_content_type with argument path. The argument has to be the filename (f.e. Beispielbild.jpeg) !!!

-Roland

  Changed 5 months ago by thomasb

  • component changed from Client Scripts to PHP backend
  • milestone changed from later to 0.2-beta

If I get you right, calling mime_content_type(basename($fp)) should do the trick...

  Changed 5 months ago by thomasb

This does not make sense to me. How should the function access the file without the full path?

  Changed 5 months ago by rosali

Thomas,

I have tested it again:

<?php if(file_exists('c:/webspace/test.php')){ echo "type:"; echo mime_content_type('c:/webspace/test1.php'); } ?>

mime_content_type function exists on my installation (XAMPP 163) but returns null!

This is the reason why your function rc_mime_content_type breaks the whole attachment handling. If I comment out these lines all works like a charm.

-Roland

  Changed 4 months ago by alec

  • status changed from new to closed
  • resolution set to fixed

Fixed in r1594.

Note: See TracTickets for help on using tickets.