Replace chmod with phpbb_chmod in uploader where needed

Fixed missing update of subsilver2 stylechanger_side.html
This commit is contained in:
Marc Alexander
2011-04-25 00:48:13 +02:00
parent 7b8d5f0cb6
commit 5efe1d6b7c
2 changed files with 16 additions and 2 deletions

View File

@@ -287,12 +287,26 @@ class portal_upload
return sprintf($user->lang['MODULE_UPLOAD_MKDIR_FAILURE'], $dirname_check);
}
}
// leave a backup file if it already exists
if(file_exists($to))
{
// remove old backup file first
if(file_exists($to . '.bak'))
{
phpbb_chmod($to . '.bak', CHMOD_ALL);
unlink($to . '.bak');
}
rename($to, $to . '.bak');
phpbb_chmod($to, CHMOD_ALL);
unlink($to);
}
if (!@copy($from, $to))
{
return sprintf($user->lang['MODULE_COPY_FAILURE'], $to);
}
@chmod($to, octdec(0666));
@chmod($to, octdec(0644));
return true;
}