Skip to content

Commit

Permalink
Make sure attachmentUploadDir is not a string representing a director…
Browse files Browse the repository at this point in the history
…y instead of a serialized array - tries to address #2555
  • Loading branch information
emanuele45 committed Jun 19, 2016
1 parent cbf5d1a commit e544bbb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sources/subs/Attachments.subs.php
Expand Up @@ -358,7 +358,13 @@ function processAttachments($id_msg = null)
automanage_attachments_check_directory();

if (!is_array($modSettings['attachmentUploadDir']))
$modSettings['attachmentUploadDir'] = unserialize($modSettings['attachmentUploadDir']);
{
$attachmentUploadDir = @unserialize($modSettings['attachmentUploadDir']);
if (!empty($attachmentUploadDir))
{
$modSettings['attachmentUploadDir'] = $attachmentUploadDir;
}
}

$context['attach_dir'] = $modSettings['attachmentUploadDir'][$modSettings['currentAttachmentUploadDir']];

Expand Down

0 comments on commit e544bbb

Please sign in to comment.