Needs review
Project:
SWF Tools
Version:
6.x-3.0-beta4
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Feb 2011 at 22:53 UTC
Updated:
15 Feb 2011 at 22:53 UTC
For failed upload there was an stat performed on line 1284 of swftools.module, causing an warning to be displayed. I made the following modifications to fix it.
// Build an array of types that SWF Tools can react to
$mime_types = _swftools_mime_types();
// If file is one of the above types, based on the extension, return headers
$filepath = file_create_path($file);
$fileexists = file_exists($filepath);
if (isset($mime_types[$extension]) && $fileexists) {
return array(
'Content-Type: '. $mime_types[$extension],
'Content-Length: '. filesize($filepath),
);
}