2.0 RC1.1 attach upload bug

Started by feline, May 26, 2009, 05:56:29 AM

Previous topic - Next topic

feline

I think, there is a small bug in the Upload routine (function getAttachmentFilename)

I found this in the Subs.php:

// Are we using multiple directories?
if (!empty($modSettings['currentAttachmentUploadDir']))
{
if (!is_array($modSettings['attachmentUploadDir']))
$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);
$path = $modSettings['attachmentUploadDir'][$modSettings['attachmentUploadDir']];
}
else
$path = $modSettings['attachmentUploadDir'];


That produce a Error 404 in the Subs-Post at this point:

elseif (!move_uploaded_file($attachmentOptions['tmp_name'], $attachmentOptions['destination']))
fatal_lang_error('attach_timeout', 'critical');


In the Subs.php I change that to:

// Are we using multiple directories?
if (!empty($modSettings['currentAttachmentUploadDir']))
{
if (!is_array($modSettings['attachmentUploadDir']))
$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);
$path = $modSettings['attachmentUploadDir'][$modSettings['currentAttachmentUploadDir']];
}
else
$path = $modSettings['attachmentUploadDir'];


Now the Upload works.

Fel

Advertisement: