Skip to content

Commit

Permalink
Avoid that when the patch installation is completed, the package mana…
Browse files Browse the repository at this point in the history
…ger (still using the old Util without the unserialize method) crashes calling a function in Attachments.subs.php already using the new calls
  • Loading branch information
emanuele45 committed Jul 30, 2016
1 parent 4f6c6db commit 51bf889
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
12 changes: 11 additions & 1 deletion install/patch_1-0-8/modifications.xml
Expand Up @@ -1868,7 +1868,17 @@ function serializeToJson($variable, $save_callback = null)
<add><![CDATA[ if (empty($modSettings['attachmentUploadDir']))
$attachmentDir = BOARDDIR . '/attachments';
elseif (!empty($modSettings['currentAttachmentUploadDir']) && !is_array($modSettings['attachmentUploadDir']) && (@unserialize($modSettings['attachmentUploadDir']) !== false))
$attachmentDir = Util::unserialize($modSettings['attachmentUploadDir']);
{
// @todo this is here to prevent the package manager to die when complete the installation of the patch (the new Util class has not yet been loaded so we need the normal one)
if (function_exists('Util::unserialize'))
{
$attachmentDir = Util::unserialize($modSettings['attachmentUploadDir']);
}
else
{
$attachmentDir = unserialize($modSettings['attachmentUploadDir']);
}
}
else
$attachmentDir = $modSettings['attachmentUploadDir'];
]]></add>
Expand Down
12 changes: 11 additions & 1 deletion sources/subs/Attachments.subs.php
Expand Up @@ -1308,7 +1308,17 @@ function getAttachmentPath()
if (empty($modSettings['attachmentUploadDir']))
$attachmentDir = BOARDDIR . '/attachments';
elseif (!empty($modSettings['currentAttachmentUploadDir']) && !is_array($modSettings['attachmentUploadDir']) && (@unserialize($modSettings['attachmentUploadDir']) !== false))
$attachmentDir = Util::unserialize($modSettings['attachmentUploadDir']);
{
// @todo this is here to prevent the package manager to die when complete the installation of the patch (the new Util class has not yet been loaded so we need the normal one)
if (function_exists('Util::unserialize'))
{
$attachmentDir = Util::unserialize($modSettings['attachmentUploadDir']);
}
else
{
$attachmentDir = unserialize($modSettings['attachmentUploadDir']);
}
}
else
$attachmentDir = $modSettings['attachmentUploadDir'];

Expand Down

0 comments on commit 51bf889

Please sign in to comment.