]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Don't double-insert a bookmark
authorEvan Prodromou <evan@status.net>
Tue, 28 Dec 2010 06:57:11 +0000 (22:57 -0800)
committerEvan Prodromou <evan@status.net>
Tue, 28 Dec 2010 06:57:11 +0000 (22:57 -0800)
plugins/Bookmark/Bookmark.php

index 684532dbfe90a1815748fad6980e4753f5e53017..87715ecad621263fce7dbfd59742a0483907f4f3 100644 (file)
@@ -226,6 +226,13 @@ class Bookmark extends Memcached_DataObject
             $options = array();
         }
 
+        if (array_key_exists('uri', $options)) {
+            $other = Bookmark::staticGet('uri', $options['uri']);
+            if (!empty($other)) {
+                throw new ClientException(_('Bookmark already exists.'));
+            }
+        }
+
         if (is_string($rawtags)) {
             $rawtags = preg_split('/[\s,]+/', $rawtags);
         }
@@ -287,8 +294,6 @@ class Bookmark extends Memcached_DataObject
             }
         }
 
-        // 
-
         $hashtags = array();
         $taglinks = array();