From 0a56e88a646697140d93f073922a38823330fe0c Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 27 Dec 2010 22:57:11 -0800 Subject: [PATCH] Don't double-insert a bookmark --- plugins/Bookmark/Bookmark.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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(); -- 2.39.5