if upload_collision_handler is set to 'don't merge tags', then don't merge tags
This commit is contained in:
parent
e56bd7b276
commit
8b62ad281a
@ -301,14 +301,12 @@ class ImageIO extends Extension {
|
|||||||
$existing = Image::by_hash($image->hash);
|
$existing = Image::by_hash($image->hash);
|
||||||
if(!is_null($existing)) {
|
if(!is_null($existing)) {
|
||||||
$handler = $config->get_string("upload_collision_handler");
|
$handler = $config->get_string("upload_collision_handler");
|
||||||
if($handler == "merge") {
|
if($handler == "merge" || isset($_GET['update'])) {
|
||||||
$merged = array_merge($image->get_tag_array(), $existing->get_tag_array());
|
$merged = array_merge($image->get_tag_array(), $existing->get_tag_array());
|
||||||
send_event(new TagSetEvent($existing, $merged));
|
send_event(new TagSetEvent($existing, $merged));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$merged = array_merge($image->get_tag_array(), $existing->get_tag_array()); //TODO: Make this only work if &update=1 is set
|
|
||||||
send_event(new TagSetEvent($existing, $merged)); //Update tags even if image exists
|
|
||||||
$error = "Image <a href='".make_link("post/view/{$existing->id}")."'>{$existing->id}</a> ".
|
$error = "Image <a href='".make_link("post/view/{$existing->id}")."'>{$existing->id}</a> ".
|
||||||
"already has hash {$image->hash}:<p>".Themelet::build_thumb_html($existing);
|
"already has hash {$image->hash}:<p>".Themelet::build_thumb_html($existing);
|
||||||
throw new ImageAdditionException($error);
|
throw new ImageAdditionException($error);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user