]> git.mxchange.org Git - friendica.git/blobdiff - mod/ping.php
Fix escaping in email notification template
[friendica.git] / mod / ping.php
index 5ea75727a1152d6d3f12943dcb7b5b9eb684fcbc..40700f36f862c70486e949a5f2a9d826fb3758c6 100644 (file)
@@ -150,25 +150,21 @@ function ping_init(App $a)
                }
 
                if ($network_count) {
-                       if (intval(Feature::isEnabled(local_user(), 'groups'))) {
-                               // Find out how unseen network posts are spread across groups
-                               $group_counts = Group::countUnseen();
-                               if (DBA::isResult($group_counts)) {
-                                       foreach ($group_counts as $group_count) {
-                                               if ($group_count['count'] > 0) {
-                                                       $groups_unseen[] = $group_count;
-                                               }
+                       // Find out how unseen network posts are spread across groups
+                       $group_counts = Group::countUnseen();
+                       if (DBA::isResult($group_counts)) {
+                               foreach ($group_counts as $group_count) {
+                                       if ($group_count['count'] > 0) {
+                                               $groups_unseen[] = $group_count;
                                        }
                                }
                        }
 
-                       if (intval(Feature::isEnabled(local_user(), 'forumlist_widget'))) {
-                               $forum_counts = ForumManager::countUnseenItems();
-                               if (DBA::isResult($forum_counts)) {
-                                       foreach ($forum_counts as $forum_count) {
-                                               if ($forum_count['count'] > 0) {
-                                                       $forums_unseen[] = $forum_count;
-                                               }
+                       $forum_counts = ForumManager::countUnseenItems();
+                       if (DBA::isResult($forum_counts)) {
+                               foreach ($forum_counts as $forum_count) {
+                                       if ($forum_count['count'] > 0) {
+                                               $forums_unseen[] = $forum_count;
                                        }
                                }
                        }
@@ -192,7 +188,7 @@ function ping_init(App $a)
                $intro_count = count($intros1) + count($intros2);
                $intros = $intros1 + $intros2;
 
-               $myurl = System::baseUrl() . '/profile/' . $a->user['nickname'] ;
+               $myurl = System::baseUrl() . '/profile/' . $a->user['nickname'];
                $mails = q(
                        "SELECT `id`, `from-name`, `from-url`, `from-photo`, `created` FROM `mail`
                        WHERE `uid` = %d AND `seen` = 0 AND `from-url` != '%s' ",
@@ -221,7 +217,7 @@ function ping_init(App $a)
                                DBA::escape(DateTimeFormat::utcNow())
                        );
                        if (DBA::isResult($ev)) {
-                               Cache::set($cachekey, $ev, CACHE_HOUR);
+                               Cache::set($cachekey, $ev, Cache::HOUR);
                        }
                }
 
@@ -377,12 +373,12 @@ function ping_init(App $a)
        $sysmsgs = [];
        $sysmsgs_info = [];
 
-       if (x($_SESSION, 'sysmsg')) {
+       if (!empty($_SESSION['sysmsg'])) {
                $sysmsgs = $_SESSION['sysmsg'];
                unset($_SESSION['sysmsg']);
        }
 
-       if (x($_SESSION, 'sysmsg_info')) {
+       if (!empty($_SESSION['sysmsg_info'])) {
                $sysmsgs_info = $_SESSION['sysmsg_info'];
                unset($_SESSION['sysmsg_info']);
        }
@@ -487,7 +483,7 @@ function ping_get_notifications($uid)
 
                        if ($notification["visible"]
                                && !$notification["deleted"]
-                               && !(x($result, $notification["parent"]) && !empty($result[$notification["parent"]]))
+                               && empty($result[$notification["parent"]])
                        ) {
                                // Should we condense the notifications or show them all?
                                if (PConfig::get(local_user(), 'system', 'detailed_notif')) {