X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=addon%2Ftwitter%2Ftwitter.php;h=1dce9d2f66a38b5b0b6b28f1ec55742504b33442;hb=8cc6e69705c40b942ff74f757d8db743c479646a;hp=7829799bc1a9129ff1abfd9b2c0f081f577a7d41;hpb=96857389ac6a9ab11f0543da5b0af3895dfccfaf;p=friendica.git diff --git a/addon/twitter/twitter.php b/addon/twitter/twitter.php index 7829799bc1..1dce9d2f66 100644 --- a/addon/twitter/twitter.php +++ b/addon/twitter/twitter.php @@ -76,6 +76,9 @@ function twitter_jot_nets(&$a,&$b) { function twitter_settings_post ($a,$post) { if(! local_user()) return; + // don't check twitter settings if twitter submit button is not clicked + if (!x($_POST,'twitter-submit')) return; + if (isset($_POST['twitter-disconnect'])) { /*** * if the twitter-disconnect checkbox is set, clear the OAuth key/secret pair @@ -159,7 +162,7 @@ function twitter_settings(&$a,&$s) { $s .= ''; $s .= ''; $s .= '
'; - $s .= ''; + $s .= ''; } else { /*** * we have an OAuth key / secret pair for the user @@ -178,7 +181,7 @@ function twitter_settings(&$a,&$s) { $s .= ''; $s .= ''; $s .= ''; - $s .= ''; + $s .= ''; } } $s .= ''; @@ -213,6 +216,7 @@ function twitter_post_hook(&$a,&$b) { $twitter_enable = (($twitter_post && x($_POST,'twitter_enable')) ? intval($_POST['twitter_enable']) : 0); if($twitter_post && $twitter_enable) { + logger('Posting to Twitter', LOGGER_DEBUG); require_once('library/twitteroauth.php'); require_once('include/bbcode.php'); $tweet = new TwitterOAuth($ckey,$csecret,$otoken,$osecret);