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

Started by Xhanch Studio, November 23, 2011, 10:03:17 AM

previous topic - next topic
Go Down

Xhanch Studio

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:
Code Select
// 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:
Code Select
// 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:
Code Select
if (empty($modSettings['enableCompressedOutput']) || filesize($filename) > 4194304)
    header('Content-Length: ' . filesize($filename));

replace with:
Code Select
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.
Best Regards,
Susanto B.Sc
----------------------------------------------------------------------------
Web development services, WordPress plugin and theme development, PSD to XHTML conversion - http://xhanch.com
Read free manga online - http://authrone.com

Go Up