1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 12:20:44 +02:00

EONE-1 (Bug): Moving of forum attachments is now at least attempted.

This commit is contained in:
mcfly
2010-03-18 01:14:08 +00:00
parent d31102d768
commit b99a2ad06e

View File

@@ -1015,13 +1015,14 @@ class forumUpgrade
function moveAttachment($attachment, &$error)
{
set_time_limit(30);
$tmp = split('/', $attachment['name']);
$old = str_replace('{e_FILE}', e_FILE, $attachment['name']);
$new = e_PLUGIN.'forum/attachments/'.$tmp[1];
if(!file_exists($new))
{
// $r = copy($old, $new);
$r = true;
$r = copy($old, $new);
// $r = true;
}
else
{
@@ -1044,8 +1045,8 @@ class forumUpgrade
$newThumb = e_PLUGIN.'forum/attachments/thumb/'.$tmp[1];
if(!file_exists($new))
{
// $r = copy($oldThumb, $newThumb);
$r = true;
$r = copy($oldThumb, $newThumb);
// $r = true;
}
else
{
@@ -1062,8 +1063,8 @@ class forumUpgrade
}
//Copy was successful, let's delete the original files now.
$r = true;
// $r = unlink($old);
// $r = true;
$r = unlink($old);
if(!$r)
{
$error = 'Was unable to delete old attachment: '.$old;
@@ -1071,8 +1072,8 @@ class forumUpgrade
}
if($oldThumb)
{
$r = true;
// $r = unlink($oldThumb);
// $r = true;
$r = unlink($oldThumb);
if(!$r)
{
$error = 'Was unable to delete old thumb: '.$oldThumb;