XHanch Studio Log in | Register | Cart

Forum

Notifications
Clear all

[Troubleshoot] SMF 2 attachments are downloaded as index.php since Firefox 8

1 Posts
1 Users
0 Likes
2,768 Views
XHanch
(@xhanch-alt)
Posts: 2105
Member Admin
Topic starter
 

With Firefox 8 (and the new FF 9 alpha) the attachment download don't work.
We found a solution for the problem and will give this to all Member.

You have to made 2 small modification on the file Sources/Display.php

Find these codes:

// Different browsers like different standards...
    if($context['browser']['is_firefox'])
        header('Content-Disposition: ' . $disposition . '; filename*="UTF-8''' . preg_replace('~&#(d{3,8});~e', '$fixchar('$1')', $utf8name) . '"');

replace with:

// Different browsers like different standards...
    if ($context['browser']['is_firefox'])
        header('Content-Disposition: ' . $disposition . '; filename*=UTF-8''' . rawurlencode(preg_replace('~&#(d{3,8});~e', '$fixchar('$1')', $utf8name)));

Find these codes:

if (empty($modSettings['enableCompressedOutput']) || filesize($filename) > 4194304)
    header('Content-Length: ' . filesize($filename));

replace with:

if ($context['browser']['is_firefox'])
    header('Content-Length: ' . filesize($filename));
else
    if (empty($modSettings['enableCompressedOutput']) || filesize($filename) > 4194304)
        header('Content-Length: ' . filesize($filename));

Your problem should have been solved.

 
Posted : 23/11/2011 5:03 pm
Share:

× Close Menu