]> git.mxchange.org Git - friendica.git/commitdiff
Fix possibly undefined variables
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 21 Jan 2019 21:53:03 +0000 (16:53 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Wed, 23 Jan 2019 14:06:59 +0000 (09:06 -0500)
src/Content/ForumManager.php
src/Content/Widget/TagCloud.php
src/Model/Event.php
src/Model/Term.php
src/Module/Photo.php

index d39ea30294793387fe71faabf7850b18b4da396c..d0aefd306225c777a7ba8521d5036018fee9ef15 100644 (file)
@@ -105,6 +105,8 @@ class ForumManager
                if (DBA::isResult($contacts)) {
                        $id = 0;
 
+                       $entries = [];
+
                        foreach ($contacts as $contact) {
                                $selected = (($cid == $contact['id']) ? ' forum-selected' : '');
 
index f2b94b11140f0504ed42ced3beaa34bbbc70f840..62301729b71140c00e3cefb5e50f302af8690247 100644 (file)
@@ -40,6 +40,7 @@ class TagCloud
                        $contact = DBA::selectFirst('contact', ['url'], ['uid' => $uid, 'self' => true]);
                        $url = System::removedBaseUrl($contact['url']);
 
+                       $tags = [];
                        foreach ($r as $rr) {
                                $tag['level'] = $rr[2];
                                $tag['url'] = $url . '?tag=' . urlencode($rr[0]);
index cd08c314afa5ffe521a3fab5305f4037499acf59..3ce86017ba99028203aeb946a09c1a70bbe530cb 100644 (file)
@@ -644,15 +644,17 @@ class Event extends BaseObject
         */
        private static function formatListForExport(array $events, $format)
        {
+               $o = '';
+
                if (!count($events)) {
-                       return '';
+                       return $o;
                }
 
                switch ($format) {
                        // Format the exported data as a CSV file.
                        case "csv":
                                header("Content-type: text/csv");
-                               $o = '"Subject", "Start Date", "Start Time", "Description", "End Date", "End Time", "Location"' . PHP_EOL;
+                               $o .= '"Subject", "Start Date", "Start Time", "Description", "End Date", "End Time", "Location"' . PHP_EOL;
 
                                foreach ($events as $event) {
                                        /// @todo The time / date entries don't include any information about the
index 28c28fb1a95e8c42073c9bd80942026cc36b5c13..6a213d445b2df4c7b036c7c0728b8cd86a8d13a4 100644 (file)
@@ -274,6 +274,7 @@ class Term
                                'network' => $item['author-network'], 'url' => $item['author-link']];
                        $tag['url'] = Contact::magicLinkByContact($author, $tag['url']);
 
+                       $prefix = '';
                        if ($tag['type'] == TERM_HASHTAG) {
                                if ($orig_tag != $tag['url']) {
                                        $item['body'] = str_replace($orig_tag, $tag['url'], $item['body']);
index 994d0efa61959b7e757c441f3f317f348baefc4c..15ea261fb0cf6ac1093e2f940d6bbd6df36d54c4 100644 (file)
@@ -46,28 +46,29 @@ class Photo extends BaseModule
                }
 
                $customsize = 0;
+               $photo = false;
                switch($a->argc) {
-               case 4:
-                       $customsize = intval($a->argv[2]);
-                       $uid = self::stripExtension($a->argv[3]);
-                       $photo = self::getAvatar($uid, $a->argv[1]);
-                       break;
-               case 3:
-                       $uid = self::stripExtension($a->argv[2]);
-                       $photo = self::getAvatar($uid, $a->argv[1]);
-                       break;
-               case 2:
-                       $photoid = self::stripExtension($a->argv[1]);
-                       $scale = 0;
-                       if (substr($photoid, -2, 1) == "-") {
-                               $scale = intval(substr($photoid, -1, 1));
-                               $photoid = substr($photoid, 0, -2);
-                       }
-                       $photo = MPhoto::getPhoto($photoid, $scale);
-                       if ($photo === false) {
-                               $photo = MPhoto::createPhotoForSystemResource("images/nosign.jpg");
-                       }
-                       break;
+                       case 4:
+                               $customsize = intval($a->argv[2]);
+                               $uid = self::stripExtension($a->argv[3]);
+                               $photo = self::getAvatar($uid, $a->argv[1]);
+                               break;
+                       case 3:
+                               $uid = self::stripExtension($a->argv[2]);
+                               $photo = self::getAvatar($uid, $a->argv[1]);
+                               break;
+                       case 2:
+                               $photoid = self::stripExtension($a->argv[1]);
+                               $scale = 0;
+                               if (substr($photoid, -2, 1) == "-") {
+                                       $scale = intval(substr($photoid, -1, 1));
+                                       $photoid = substr($photoid, 0, -2);
+                               }
+                               $photo = MPhoto::getPhoto($photoid, $scale);
+                               if ($photo === false) {
+                                       $photo = MPhoto::createPhotoForSystemResource("images/nosign.jpg");
+                               }
+                               break;
                }
 
                if ($photo === false) {