From 4777c927add9159720ab3ffce98848b346187569 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 27 Dec 2010 09:14:11 -0800 Subject: [PATCH] Fix bookmark replies handling so doesn't overwrite --- plugins/Bookmark/Bookmark.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/plugins/Bookmark/Bookmark.php b/plugins/Bookmark/Bookmark.php index c3394c542b..684532dbfe 100644 --- a/plugins/Bookmark/Bookmark.php +++ b/plugins/Bookmark/Bookmark.php @@ -274,11 +274,13 @@ class Bookmark extends Memcached_DataObject foreach ($rawtags as $tag) { if (strtolower(mb_substr($tag, 0, 4)) == 'for:') { - $nickname = mb_substr($tag, 4); - $other = common_relative_profile($profile, - $nickname); - if (!empty($other)) { - $replies[] = $other->getUri(); + if (!array_key_exists('replies', $options)) { // skip if done by caller + $nickname = mb_substr($tag, 4); + $other = common_relative_profile($profile, + $nickname); + if (!empty($other)) { + $replies[] = $other->getUri(); + } } } else { $tags[] = common_canonical_tag($tag); @@ -321,10 +323,11 @@ class Bookmark extends Memcached_DataObject htmlspecialchars($description), implode(' ', $taglinks)); - $options = array_merge($options, array('urls' => array($url), - 'rendered' => $rendered, - 'tags' => $tags, - 'replies' => $replies)); + $options = array_merge(array('urls' => array($url), + 'rendered' => $rendered, + 'tags' => $tags, + 'replies' => $replies), + $options); if (!array_key_exists('uri', $options)) { $options['uri'] = $nb->uri; -- 2.39.5