fix: 🐛 fix wrong usave of copy (should have been move_uploaded_file)
Some checks failed
/ phplint (push) Failing after 3s

This commit is contained in:
David Bailey 2023-12-14 11:48:03 +01:00
parent a82290cf73
commit 2f5d59dd32

View file

@ -55,7 +55,7 @@ class PostHandler extends MySQLAdapter {
function save_file($post_path, $file_path) {
$this->bump_post($post_path);
copy($file_path, $this->data_directory . $post_path);
move_uploaded_file($file_path, $this->data_directory . $post_path);
}
function save_markdown_post($post_path, $post_data) {
@ -66,7 +66,6 @@ class PostHandler extends MySQLAdapter {
$post_metadata = $frontmatter_post->matter();
if(basename($post_path) == "README.md") {
$readme_metadata = [];
if(isset($post_metadata['directory_data'])) {
$readme_metadata = $post_metadata['directory_data'];
@ -86,8 +85,7 @@ class PostHandler extends MySQLAdapter {
case "md":
$this->save_markdown_post($post_path, file_get_contents($file_path));
file_put_contents($this->data_directory . $post_path,
$post_data);
move_uploaded_file($file_path, $this->data_directory . $post_path);
break;
case "mddesc":
$this->save_markdown_post(chop($post_path, '.mddesc'), file_get_contents($file_path));