]> git.mxchange.org Git - friendica.git/blobdiff - mod/notifications.php
Merge branch 'develop' into rewrites/dbm_is_result
[friendica.git] / mod / notifications.php
index d43e2cc04f95a68aab760207fa4242b9f7a55203..e4fa08f3e2be4e9840b246ccae929e9a82975540 100644 (file)
@@ -9,9 +9,9 @@ require_once("include/NotificationsManager.php");
 require_once("include/contact_selectors.php");
 require_once("include/network.php");
 
-function notifications_post(&$a) {
+function notifications_post(App &$a) {
 
-       if(! local_user()) {
+       if (! local_user()) {
                goaway(z_root());
        }
 
@@ -27,7 +27,7 @@ function notifications_post(&$a) {
                        intval(local_user())
                );
 
-               if(count($r)) {
+               if (dbm::is_result($r)) {
                        $intro_id = $r[0]['id'];
                        $contact_id = $r[0]['contact-id'];
                }
@@ -65,9 +65,9 @@ function notifications_post(&$a) {
        }
 }
 
-function notifications_content(&$a) {
+function notifications_content(App &$a) {
 
-       if(! local_user()) {
+       if (! local_user()) {
                notice( t('Permission denied.') . EOL);
                return;
        }
@@ -285,7 +285,7 @@ function notifications_content(&$a) {
                                '$item_label' => $it['label'],
                                '$item_link' => $it['link'],
                                '$item_image' => $it['image'],
-                               '$item_text' => $it['text'],
+                               '$item_text' => htmlentities($it['text']),
                                '$item_when' => $it['when'],
                                '$item_seen' => $it['seen'],
                        ));
@@ -305,7 +305,6 @@ function notifications_content(&$a) {
                        $notif_nocontent = sprintf( t('No more %s notifications.'), $notifs['ident']);
        }
 
-
        $o .= replace_macros($notif_tpl, array(
                '$notif_header' => $notif_header,
                '$tabs' => $tabs,