]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Daisychaining bug with exceptions in PHP
authorMikael Nordfeldth <mmn@hethane.se>
Tue, 22 Oct 2013 13:34:22 +0000 (15:34 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Tue, 22 Oct 2013 13:36:02 +0000 (15:36 +0200)
lib/apiaction.php
lib/implugin.php

index 354e1887bb8d06c0532cd2e2e04ecbe7adb41c90..481dcf1b9529a23e7fb6ca04dc1e70eb10f0d8ed 100644 (file)
@@ -315,7 +315,10 @@ class ApiAction extends Action
         $twitter_status['truncated'] = false; # Not possible on StatusNet
         $twitter_status['created_at'] = $this->dateTwitter($notice->created);
         try {
-            $in_reply_to = $notice->getParent()->id;
+            // We could just do $notice->reply_to but maybe the future holds a
+            // different story for parenting.
+            $parent = $notice->getParent();
+            $in_reply_to = $parent->id;
         } catch (Exception $e) {
             $in_reply_to = null;
         }
index def9a942c90b27620053f0b826c26a072a00f0ca..4ee9d854663e22cd240df05d189da15b28a938b4 100644 (file)
@@ -375,7 +375,8 @@ abstract class ImPlugin extends Plugin
         $profile = $notice->getProfile();
 
         try {
-            $orig_profile = $notice->getParent()->getProfile();
+            $parent = $notice->getParent();
+            $orig_profile = $parent->getProfile();
             $nicknames = sprintf('%1$s => %2$s', $profile->nickname, $orig_profile->nickname);
         } catch (Exception $e) {
             $nicknames = $profile->nickname;