]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
repost_of -> repeat_of, also trying with isset()
authorMikael Nordfeldth <mmn@hethane.se>
Fri, 17 Jun 2016 21:53:05 +0000 (23:53 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Fri, 17 Jun 2016 21:53:05 +0000 (23:53 +0200)
plugins/Linkback/lib/util.php

index 74dedf884004eb1a07454ac82c6b8a5e2a9cd8fd..c6ad121695a95bd936aea6f77fc491026f92b384 100644 (file)
@@ -395,10 +395,14 @@ function linkback_save($source, $target, $response, $notice_or_user) {
             try { $dupe->saveKnownTags($options['tags']); } catch (ServerException $ex) {}
             try { $dupe->saveKnownUrls($options['urls']); } catch (ServerException $ex) {}
 
-            if($options['reply_to']) { $dupe->reply_to = $options['reply_to']; }
-            if($options['repeat_of']) { $dupe->repeat_of = $options['repeat_of']; }
-            if($dupe->reply_to != $orig->reply_to || $dupe->repeat_of != $orig->repeat_of) {
-                $parent = Notice::getKV('id', $dupe->repost_of ? $dupe->repost_of : $dupe->reply_to);
+            if (isset($options['reply_to'])) {
+                $dupe->reply_to = $options['reply_to'];
+            }
+            if (isset($options['repeat_of'])) {
+                $dupe->repeat_of = $options['repeat_of'];
+            }
+            if ($dupe->reply_to != $orig->reply_to || $dupe->repeat_of != $orig->repeat_of) {
+                $parent = Notice::getKV('id', $dupe->repeat_of ?: $dupe->reply_to);
                 if($parent instanceof Notice) {
                     // If we changed the reply_to or repeat_of we might live in a new conversation now
                     $dupe->conversation = $parent->conversation;