Daisychaining bug with exceptions in PHP
This commit is contained in:
parent
a6c52c5ca7
commit
b46c1746f2
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user