Added safety check for tag renaming
This commit is contained in:
parent
f7a0b7b440
commit
101864459d
1 changed files with 3 additions and 0 deletions
|
@ -81,6 +81,9 @@ class TagController
|
||||||
|
|
||||||
$suppliedTargetTag = InputHelper::get('target-tag');
|
$suppliedTargetTag = InputHelper::get('target-tag');
|
||||||
$suppliedTargetTag = Model_Tag::validateTag($suppliedTargetTag);
|
$suppliedTargetTag = Model_Tag::validateTag($suppliedTargetTag);
|
||||||
|
$targetTag = Model_Tag::locate($suppliedTargetTag, false);
|
||||||
|
if ($targetTag)
|
||||||
|
throw new SimpleException('Target tag already exists');
|
||||||
|
|
||||||
$sourceTag = Model_Tag::locate($suppliedSourceTag);
|
$sourceTag = Model_Tag::locate($suppliedSourceTag);
|
||||||
$sourceTag->name = $suppliedTargetTag;
|
$sourceTag->name = $suppliedTargetTag;
|
||||||
|
|
Loading…
Reference in a new issue