From 101864459d13a7e12a959665c82890ee002a2138 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Fri, 1 Nov 2013 20:44:01 +0100 Subject: [PATCH] Added safety check for tag renaming --- src/Controllers/TagController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Controllers/TagController.php b/src/Controllers/TagController.php index 356ad8a0..da741301 100644 --- a/src/Controllers/TagController.php +++ b/src/Controllers/TagController.php @@ -81,6 +81,9 @@ class TagController $suppliedTargetTag = InputHelper::get('target-tag'); $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->name = $suppliedTargetTag;