mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 13:17:24 +02:00
EONE-1 (Bug): Moving of forum attachments is now at least attempted.
This commit is contained in:
@@ -1015,13 +1015,14 @@ class forumUpgrade
|
|||||||
|
|
||||||
function moveAttachment($attachment, &$error)
|
function moveAttachment($attachment, &$error)
|
||||||
{
|
{
|
||||||
|
set_time_limit(30);
|
||||||
$tmp = split('/', $attachment['name']);
|
$tmp = split('/', $attachment['name']);
|
||||||
$old = str_replace('{e_FILE}', e_FILE, $attachment['name']);
|
$old = str_replace('{e_FILE}', e_FILE, $attachment['name']);
|
||||||
$new = e_PLUGIN.'forum/attachments/'.$tmp[1];
|
$new = e_PLUGIN.'forum/attachments/'.$tmp[1];
|
||||||
if(!file_exists($new))
|
if(!file_exists($new))
|
||||||
{
|
{
|
||||||
// $r = copy($old, $new);
|
$r = copy($old, $new);
|
||||||
$r = true;
|
// $r = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1044,8 +1045,8 @@ class forumUpgrade
|
|||||||
$newThumb = e_PLUGIN.'forum/attachments/thumb/'.$tmp[1];
|
$newThumb = e_PLUGIN.'forum/attachments/thumb/'.$tmp[1];
|
||||||
if(!file_exists($new))
|
if(!file_exists($new))
|
||||||
{
|
{
|
||||||
// $r = copy($oldThumb, $newThumb);
|
$r = copy($oldThumb, $newThumb);
|
||||||
$r = true;
|
// $r = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1062,8 +1063,8 @@ class forumUpgrade
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Copy was successful, let's delete the original files now.
|
//Copy was successful, let's delete the original files now.
|
||||||
$r = true;
|
// $r = true;
|
||||||
// $r = unlink($old);
|
$r = unlink($old);
|
||||||
if(!$r)
|
if(!$r)
|
||||||
{
|
{
|
||||||
$error = 'Was unable to delete old attachment: '.$old;
|
$error = 'Was unable to delete old attachment: '.$old;
|
||||||
@@ -1071,8 +1072,8 @@ class forumUpgrade
|
|||||||
}
|
}
|
||||||
if($oldThumb)
|
if($oldThumb)
|
||||||
{
|
{
|
||||||
$r = true;
|
// $r = true;
|
||||||
// $r = unlink($oldThumb);
|
$r = unlink($oldThumb);
|
||||||
if(!$r)
|
if(!$r)
|
||||||
{
|
{
|
||||||
$error = 'Was unable to delete old thumb: '.$oldThumb;
|
$error = 'Was unable to delete old thumb: '.$oldThumb;
|
||||||
|
Reference in New Issue
Block a user