]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix bookmark replies handling so doesn't overwrite
authorEvan Prodromou <evan@status.net>
Mon, 27 Dec 2010 17:14:11 +0000 (09:14 -0800)
committerEvan Prodromou <evan@status.net>
Mon, 27 Dec 2010 17:14:11 +0000 (09:14 -0800)
plugins/Bookmark/Bookmark.php

index c3394c542b8a810efde088fdea7253720e7ae00b..684532dbfe90a1815748fad6980e4753f5e53017 100644 (file)
@@ -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;