]> git.mxchange.org Git - friendica-addons.git/commitdiff
Merge pull request #483 from MrPetovan/task/fix-scrutinizer-issues
authorMichael Vogel <icarus@dabo.de>
Thu, 4 Jan 2018 19:59:43 +0000 (20:59 +0100)
committerGitHub <noreply@github.com>
Thu, 4 Jan 2018 19:59:43 +0000 (20:59 +0100)
Fix unused code in buffer, statusnet and twitter

1  2 
statusnet/statusnet.php
twitter/twitter.php

diff --combined statusnet/statusnet.php
index 23110d4fd686f556ca40de63f46f147e30c93e98,1a8766a33f1ab900ee3f7629646f319de32b5b92..659ddaef2a59a13840a6022bd9dcaac0cdb3fadb
@@@ -241,7 -241,7 +241,7 @@@ function statusnet_settings_post(App $a
                                        }
                                }
                        }
 -                      goaway($a->get_baseurl() . '/settings/connectors');
 +                      goaway('settings/connectors');
                } else {
                        if (isset($_POST['statusnet-consumersecret'])) {
                                //  check if we can reach the API of the GNU Social server
                                                notice(t('We could not contact the GNU Social API with the Path you entered.') . EOL);
                                        }
                                }
 -                              goaway($a->get_baseurl() . '/settings/connectors');
 +                              goaway('settings/connectors');
                        } else {
                                if (isset($_POST['statusnet-pin'])) {
                                        //  if the user supplied us with a PIN from GNU Social, let the magic of OAuth happen
                                        PConfig::set(local_user(), 'statusnet', 'post', 1);
                                        PConfig::set(local_user(), 'statusnet', 'post_taglinks', 1);
                                        //  reload the Addon Settings page, if we don't do it see Bug #42
 -                                      goaway($a->get_baseurl() . '/settings/connectors');
 +                                      goaway('settings/connectors');
                                } else {
                                        //  if no PIN is supplied in the POST variables, the user has changed the setting
                                        //  to post a dent for every new __public__ posting to the wall
@@@ -637,7 -637,7 +637,7 @@@ function statusnet_post_hook(App $a, &$
                $tempfile = "";
                require_once "include/plaintext.php";
                require_once "include/network.php";
-               $msgarr = plaintext($a, $b, $max_char, true, 7);
+               $msgarr = plaintext($b, $max_char, true, 7);
                $msg = $msgarr["text"];
  
                if (($msg == "") && isset($msgarr["title"]))
@@@ -806,7 -806,7 +806,7 @@@ function statusnet_prepare_body(App $a
                        }
                }
  
-               $msgarr = plaintext($a, $item, $max_char, true, 7);
+               $msgarr = plaintext($item, $max_char, true, 7);
                $msg = $msgarr["text"];
  
                if (isset($msgarr["url"]) && ($msgarr["type"] != "photo")) {
diff --combined twitter/twitter.php
index 8efff281e17039d4c2fe500da2986ef4ec184b12,6d0dddd9a0dc196f5de92abc6cdc90b9c61530e6..dbd0bab87892857501517f65f14658f941bcf448
@@@ -225,7 -225,7 +225,7 @@@ function twitter_settings_post(App $a, 
                        PConfig::set(local_user(), 'twitter', 'oauthsecret', $token['oauth_token_secret']);
                        PConfig::set(local_user(), 'twitter', 'post', 1);
                        //  reload the Addon Settings page, if we don't do it see Bug #42
 -                      goaway($a->get_baseurl() . '/settings/connectors');
 +                      goaway('settings/connectors');
                } else {
                        //  if no PIN is supplied in the POST variables, the user has changed the setting
                        //  to post a tweet for every new __public__ posting to the wall
@@@ -523,7 -523,7 +523,7 @@@ function twitter_post_hook(App $a, &$b
  
                $max_char = 280;
                require_once "include/plaintext.php";
-               $msgarr = plaintext($a, $b, $max_char, true, 8);
+               $msgarr = plaintext($b, $max_char, true, 8);
                $msg = $msgarr["text"];
  
                if (($msg == "") && isset($msgarr["title"])) {
  // -----------------
                        $max_char = 280;
                        require_once "include/plaintext.php";
-                       $msgarr = plaintext($a, $b, $max_char, true, 8);
+                       $msgarr = plaintext($b, $max_char, true, 8);
                        $msg = $msgarr["text"];
  
                        if (($msg == "") && isset($msgarr["title"])) {
@@@ -789,7 -789,7 +789,7 @@@ function twitter_prepare_body(App $a, &
                        }
                }
  
-               $msgarr = plaintext($a, $item, $max_char, true, 8);
+               $msgarr = plaintext($item, $max_char, true, 8);
                $msg = $msgarr["text"];
  
                if (isset($msgarr["url"]) && ($msgarr["type"] != "photo")) {