Fixed issue with merge's duplicate hash check

This commit is contained in:
matthew 2019-07-04 12:58:15 -05:00
parent 7991e981ca
commit 38cc05cf37

View File

@ -348,7 +348,8 @@ class ImageIO extends Extension
} }
$duplicate = Image::by_hash($image->hash); $duplicate = Image::by_hash($image->hash);
if(!is_null($duplicate)) {
if(!is_null($duplicate) && $duplicate->id!=$id) {
$error = "Image <a href='" . make_link("post/view/{$duplicate->id}") . "'>{$duplicate->id}</a> " . $error = "Image <a href='" . make_link("post/view/{$duplicate->id}") . "'>{$duplicate->id}</a> " .
"already has hash {$image->hash}:<p>" . $this->theme->build_thumb_html($duplicate); "already has hash {$image->hash}:<p>" . $this->theme->build_thumb_html($duplicate);
throw new ImageReplaceException($error); throw new ImageReplaceException($error);