From e7b109a7f25cce7c3f32f3a4c59e123dbe4ac55a Mon Sep 17 00:00:00 2001 From: Matthew Barbour Date: Mon, 26 Oct 2020 10:10:00 -0500 Subject: [PATCH] Image to Post - Some core files --- core/extension.php | 8 ++++---- core/imageboard/image.php | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/core/extension.php b/core/extension.php index eb15c56a..c471e748 100644 --- a/core/extension.php +++ b/core/extension.php @@ -313,17 +313,17 @@ abstract class DataHandlerExtension extends Extension $existing = Image::by_id($event->replace_id); if (is_null($existing)) { - throw new UploadException("Image to replace does not exist!"); + throw new UploadException("Post to replace does not exist!"); } if ($existing->hash === $event->metadata['hash']) { - throw new UploadException("The uploaded image is the same as the one to replace."); + throw new UploadException("The uploaded post is the same as the one to replace."); } // even more hax.. $event->metadata['tags'] = $existing->get_tag_list(); $image = $this->create_image_from_data(warehouse_path(Image::IMAGE_DIR, $event->metadata['hash']), $event->metadata); if (is_null($image)) { - throw new UploadException("Data handler failed to create image object from data"); + throw new UploadException("Data handler failed to create post object from data"); } if (empty($image->get_mime())) { throw new UploadException("Unable to determine MIME for ". $event->tmpname); @@ -339,7 +339,7 @@ abstract class DataHandlerExtension extends Extension } else { $image = $this->create_image_from_data(warehouse_path(Image::IMAGE_DIR, $event->hash), $event->metadata); if (is_null($image)) { - throw new UploadException("Data handler failed to create image object from data"); + throw new UploadException("Data handler failed to create post object from data"); } if (empty($image->get_mime())) { throw new UploadException("Unable to determine MIME for ". $event->tmpname); diff --git a/core/imageboard/image.php b/core/imageboard/image.php index e5f2b156..e6a5c547 100644 --- a/core/imageboard/image.php +++ b/core/imageboard/image.php @@ -395,7 +395,7 @@ class Image SET owner_id=:owner_id WHERE id=:id ", ["owner_id"=>$owner->id, "id"=>$this->id]); - log_info("core_image", "Owner for Image #{$this->id} set to {$owner->name}"); + log_info("core_image", "Owner for Post #{$this->id} set to {$owner->name}"); } } @@ -647,7 +647,7 @@ class Image } if ($new_source != $old_source) { $database->execute("UPDATE images SET source=:source WHERE id=:id", ["source"=>$new_source, "id"=>$this->id]); - log_info("core_image", "Source for Image #{$this->id} set to: $new_source (was $old_source)"); + log_info("core_image", "Source for Post #{$this->id} set to: $new_source (was $old_source)"); } } @@ -668,7 +668,7 @@ class Image $sln = str_replace('"', "", $sln); if (bool_escape($sln) !== $this->locked) { $database->execute("UPDATE images SET locked=:yn WHERE id=:id", ["yn"=>$sln, "id"=>$this->id]); - log_info("core_image", "Setting Image #{$this->id} lock to: $ln"); + log_info("core_image", "Setting Post #{$this->id} lock to: $ln"); } } @@ -785,7 +785,7 @@ class Image ); } - log_info("core_image", "Tags for Image #{$this->id} set to: ".Tag::implode($tags)); + log_info("core_image", "Tags for Post #{$this->id} set to: ".Tag::implode($tags)); $cache->delete("image-{$this->id}-tags"); } } @@ -798,7 +798,7 @@ class Image global $database; $this->delete_tags_from_image(); $database->execute("DELETE FROM images WHERE id=:id", ["id"=>$this->id]); - log_info("core_image", 'Deleted Image #'.$this->id.' ('.$this->hash.')'); + log_info("core_image", 'Deleted Post #'.$this->id.' ('.$this->hash.')'); unlink($this->get_image_filename()); unlink($this->get_thumb_filename()); @@ -810,7 +810,7 @@ class Image */ public function remove_image_only(): void { - log_info("core_image", 'Removed Image File ('.$this->hash.')'); + log_info("core_image", 'Removed Post File ('.$this->hash.')'); @unlink($this->get_image_filename()); @unlink($this->get_thumb_filename()); }