diff --git a/twitter/twitter.php b/twitter/twitter.php index eeee6caf..d846b1ad 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -352,7 +352,10 @@ function twitter_settings(App $a, &$s) $field_checkbox = Renderer::getMarkupTemplate('field_checkbox.tpl'); - $s .= '
+ if (property_exists($details, 'screen_name') && + property_exists($details, 'description') && + property_exists($details, 'profile_image_url')) { + $s .= '

' . L10n::t('Currently connected to: ') . '' . $details->screen_name . '

@@ -361,6 +364,12 @@ function twitter_settings(App $a, &$s) ' . $details->description . '

'; + } else { + $s .= '
+

Invalid Twitter info

+
'; + Logger::info('Invalid twitter info (verify credentials).', ['auth' => TwitterOAuth::class]); + } $s .= '
'; $s .= Renderer::replaceMacros($field_checkbox, [