From: Mikael Nordfeldth <mmn@hethane.se>
Date: Sun, 8 Feb 2015 22:48:35 +0000 (+0100)
Subject: Can now delete lists/peopletags (thanks MrB)
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8616055959c6ac4ae91fe5fc62e8c8ac2aa7257c;p=quix0rs-gnu-social.git

Can now delete lists/peopletags (thanks MrB)

Reported on https://bugz.foocorp.net/T79
Fix by MrB: https://gist.github.com/mrvdb/0f5d84c9b56c0a390c4a
---

diff --git a/actions/editpeopletag.php b/actions/editpeopletag.php
index c812255c70..45c8adaa7d 100644
--- a/actions/editpeopletag.php
+++ b/actions/editpeopletag.php
@@ -277,6 +277,14 @@ class EditpeopletagAction extends Action
             return;
         }
 
+        // We tested $delete && !$confirm earlier so confirmation is required before getting here
+        if ($delete) {
+            // This might take quite a bit of time.
+            $this->peopletag->delete();
+            // send home.
+            common_redirect(common_local_url('all', array('nickname' => $this->tagger->getNickname())), 303);
+        }
+
         $this->peopletag->query('BEGIN');
 
         $orig = clone($this->peopletag);
@@ -301,13 +309,6 @@ class EditpeopletagAction extends Action
             Profile_tag_subscription::cleanup($this->peopletag);
         }
 
-        if ($delete) {
-            // This might take quite a bit of time.
-            $this->peopletag->delete();
-            // send home.
-            common_redirect(common_local_url('all', array('nickname' => $this->tagger->nickname)), 303);
-        }
-
         if ($tag != $orig->tag) {
             common_redirect(common_local_url('editpeopletag',
                                              array('tagger' => $this->tagger->nickname,