mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-29 14:48:52 +03:00
[TwitterV2Bridge] Fix empty object check (#2673)
This commit is contained in:
parent
9dc31dfcfa
commit
4c26950b71
1 changed files with 6 additions and 1 deletions
|
@ -362,6 +362,7 @@ EOD
|
||||||
|
|
||||||
// Start setting values needed for HTML output
|
// Start setting values needed for HTML output
|
||||||
if($isRetweet || is_null($user)) {
|
if($isRetweet || is_null($user)) {
|
||||||
|
Debug::log('Tweet is retweet, or $user is null');
|
||||||
// Replace tweet object with original retweeted object
|
// Replace tweet object with original retweeted object
|
||||||
if($isRetweet) {
|
if($isRetweet) {
|
||||||
foreach($includesTweets as $includesTweet) {
|
foreach($includesTweets as $includesTweet) {
|
||||||
|
@ -380,17 +381,21 @@ EOD
|
||||||
// Get user object for retweeted tweet
|
// Get user object for retweeted tweet
|
||||||
$originalUser = new stdClass(); // make the linters stop complaining
|
$originalUser = new stdClass(); // make the linters stop complaining
|
||||||
if(isset($retweetedUsers)) {
|
if(isset($retweetedUsers)) {
|
||||||
|
Debug::log('Searching for tweet author_id in $retweetedUsers');
|
||||||
foreach($retweetedUsers as $retweetedUser) {
|
foreach($retweetedUsers as $retweetedUser) {
|
||||||
if($retweetedUser->id === $tweet->author_id) {
|
if($retweetedUser->id === $tweet->author_id) {
|
||||||
$originalUser = $retweetedUser;
|
$originalUser = $retweetedUser;
|
||||||
|
Debug::log('Found author_id match in $retweetedUsers');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!$originalUser && isset($includesUsers)) {
|
if(!isset($originalUser->username) && isset($includesUsers)) {
|
||||||
|
Debug::log('Searching for tweet author_id in $includesUsers');
|
||||||
foreach($includesUsers as $includesUser) {
|
foreach($includesUsers as $includesUser) {
|
||||||
if($includesUser->id === $tweet->author_id) {
|
if($includesUser->id === $tweet->author_id) {
|
||||||
$originalUser = $includesUser;
|
$originalUser = $includesUser;
|
||||||
|
Debug::log('Found author_id match in $includesUsers');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue