From: Evan Prodromou Date: Tue, 28 Dec 2010 06:57:11 +0000 (-0800) Subject: Don't double-insert a bookmark X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0a56e88a646697140d93f073922a38823330fe0c;p=quix0rs-gnu-social.git Don't double-insert a bookmark --- diff --git a/plugins/Bookmark/Bookmark.php b/plugins/Bookmark/Bookmark.php index 684532dbfe..87715ecad6 100644 --- a/plugins/Bookmark/Bookmark.php +++ b/plugins/Bookmark/Bookmark.php @@ -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();