]> git.mxchange.org Git - friendica.git/commitdiff
fix undeclared variables or wrong variable names (/src)
authorrabuzarus <rabuzarus@t-online.de>
Mon, 12 Feb 2018 15:08:28 +0000 (16:08 +0100)
committerrabuzarus <rabuzarus@t-online.de>
Mon, 12 Feb 2018 15:08:28 +0000 (16:08 +0100)
src/Content/Text/BBCode.php
src/Content/Widget.php
src/Model/Conversation.php
src/Model/Item.php
src/Model/Profile.php
src/Util/DateTimeFormat.php
src/Util/Network.php
src/Util/Temporal.php

index bd2a734720d4065307008a7e81ae305805c66272..14f98202e7b27b1c8a9e72c545c5602bb680abba 100644 (file)
@@ -1115,7 +1115,7 @@ class BBCode
                                $text = $preshare . html_entity_decode("&#x2672; ", ENT_QUOTES, 'UTF-8') . ' ' . $userid_compact . ": <br />" . $share[3];
                                break;
                        case 3: // Diaspora
-                               $headline .= '<b>' . html_entity_decode("&#x2672; ", ENT_QUOTES, 'UTF-8') . $userid . ':</b><br />';
+                               $headline = '<b>' . html_entity_decode("&#x2672; ", ENT_QUOTES, 'UTF-8') . $userid . ':</b><br />';
 
                                $text = trim($share[1]);
 
index c66a4ea9db0bb1c99b06da6d329ca356dd141a36..d2572429851188282071a039f2f37a2dd2dfa509 100644 (file)
@@ -51,7 +51,7 @@ class Widget
                        if ($x || is_site_admin()) {
                                $a->page['aside'] .= '<div class="side-link" id="side-invite-remain">'
                                        . L10n::tt('%d invitation available', '%d invitations available', $x)
-                                       . '</div>' . $inv;
+                                       . '</div>';
                        }
                }
 
index 3f9b3c7e5e311c1d0c97ca39cb36590acc1b9882..cd51a537ed247839bdeebf181e6f9796ac9b5bf0 100644 (file)
@@ -66,7 +66,7 @@ class Conversation
                                        unset($conversation['source']);
                                }
                                if (!dba::update('conversation', $conversation, ['item-uri' => $conversation['item-uri']], $old_conv)) {
-                                       logger('Conversation: update for '.$conversation['item-uri'].' from '.$conv['protocol'].' to '.$conversation['protocol'].' failed', LOGGER_DEBUG);
+                                       logger('Conversation: update for '.$conversation['item-uri'].' from '.$old_conv['protocol'].' to '.$conversation['protocol'].' failed', LOGGER_DEBUG);
                                }
                        } else {
                                if (!dba::insert('conversation', $conversation, true)) {
index d09681579fce77ff4e9e6eaa62b439f7c22fafb9..400bc549b16d60b0cd856454ffb48b822b799b65 100644 (file)
@@ -263,6 +263,7 @@ class Item extends BaseObject
                }
 
                $arr['guid'] = notags(trim(defaults($arr, 'guid', get_guid(32, $guid_prefix))));
+               /// @todo Declare $uid variable - Rabuzarus - 2018-02-12.
                $arr['uri'] = notags(trim(defaults($arr, 'uri', item_new_uri($a->get_hostname(), $uid, $arr['guid']))));
 
                // Store conversation data
@@ -1294,6 +1295,7 @@ class Item extends BaseObject
                        return;
                }
 
+               /// @todo Declare $r or lets remove it - Rabuzarus - 2018-02-12.
                $arr = ['item' => $item, 'user' => $u[0], 'contact' => $r[0]];
 
                Addon::callHooks('tagged', $arr);
index 002b647ffb1e43d8eb70fb2d98c34581c3e82c41..f79b89014b4e3299ecc5f9070d6b7d3929ac4529 100644 (file)
@@ -625,6 +625,7 @@ class Profile
                require_once 'include/bbcode.php';
 
                $a = get_app();
+               $o = '';
 
                if (!local_user() || $a->is_mobile || $a->is_tablet) {
                        return $o;
index b039ff80a170c4fc504e9f6ac95420ceff7b218c..31876d742b9419d8c45d342cbae31ffca4615b9e 100644 (file)
@@ -90,12 +90,12 @@ class DateTimeFormat
        {
                // Defaults to UTC if nothing is set, but throws an exception if set to empty string.
                // Provide some sane defaults regardless.
-               if ($from === '') {
-                       $from = 'UTC';
+               if ($tz_from === '') {
+                       $tz_from = 'UTC';
                }
 
-               if ($to === '') {
-                       $to = 'UTC';
+               if ($tz_to === '') {
+                       $tz_to = 'UTC';
                }
 
                if (($s === '') || (!is_string($s))) {
index 85880a9499f24d2d03d0b37c7efafac63feb6cc2..c9955f800f40252d588504590016d266f2024a36 100644 (file)
@@ -370,6 +370,9 @@ class Network
 
                if ($http_code == 301 || $http_code == 302 || $http_code == 303 || $http_code == 307) {
                        $matches = [];
+                       $new_location_info = @parse_url($curl_info['redirect_url']);
+                       $old_location_info = @parse_url($curl_info['url']);
+       
                        preg_match('/(Location:|URI:)(.*?)\n/', $header, $matches);
                        $newurl = trim(array_pop($matches));
 
index 3c898ce4cb61494d8dbe46c73bb28eda0d598938..1ed08ed1df06332df96cd70dbc51799f8874f077 100644 (file)
@@ -127,6 +127,8 @@ class Temporal
         */
        public static function getDateofBirthField($dob)
        {
+               $a = get_app();
+
                list($year, $month, $day) = sscanf($dob, '%4d-%2d-%2d');
 
                if ($dob < '0000-01-01') {