]> git.mxchange.org Git - friendica.git/blobdiff - mod/message.php
Fix introductions notifications links
[friendica.git] / mod / message.php
index fbb1391699490b056ad77032132f5d479dc6e1e7..223976ddbef637731dc24877e22c14735622924a 100644 (file)
@@ -14,6 +14,7 @@ use Friendica\Database\DBA;
 use Friendica\Model\Contact;
 use Friendica\Model\Mail;
 use Friendica\Util\DateTimeFormat;
+use Friendica\Util\Proxy as ProxyUtils;
 use Friendica\Util\Temporal;
 
 require_once 'include/conversation.php';
@@ -217,14 +218,14 @@ function message_content(App $a)
                        if (!DBA::isResult($r)) {
                                $r = q("SELECT `name`, `url`, `id` FROM `contact` WHERE `uid` = %d AND `nurl` = '%s' LIMIT 1",
                                        intval(local_user()),
-                                       dbesc(normalise_link(base64_decode($a->argv[2])))
+                                       DBA::escape(normalise_link(base64_decode($a->argv[2])))
                                );
                        }
 
                        if (!DBA::isResult($r)) {
                                $r = q("SELECT `name`, `url`, `id` FROM `contact` WHERE `uid` = %d AND `addr` = '%s' LIMIT 1",
                                        intval(local_user()),
-                                       dbesc(base64_decode($a->argv[2]))
+                                       DBA::escape(base64_decode($a->argv[2]))
                                );
                        }
 
@@ -311,10 +312,10 @@ function message_content(App $a)
                        $contact_id = $r[0]['contact-id'];
                        $convid = $r[0]['convid'];
 
-                       $sql_extra = sprintf(" and `mail`.`parent-uri` = '%s' ", dbesc($r[0]['parent-uri']));
+                       $sql_extra = sprintf(" and `mail`.`parent-uri` = '%s' ", DBA::escape($r[0]['parent-uri']));
                        if ($convid)
                                $sql_extra = sprintf(" and ( `mail`.`parent-uri` = '%s' OR `mail`.`convid` = '%d' ) ",
-                                       dbesc($r[0]['parent-uri']),
+                                       DBA::escape($r[0]['parent-uri']),
                                        intval($convid)
                                );
 
@@ -332,7 +333,7 @@ function message_content(App $a)
                }
 
                $r = q("UPDATE `mail` SET `seen` = 1 WHERE `parent-uri` = '%s' AND `uid` = %d",
-                       dbesc($r[0]['parent-uri']),
+                       DBA::escape($r[0]['parent-uri']),
                        intval(local_user())
                );
 
@@ -388,7 +389,7 @@ function message_content(App $a)
                                'from_url' => $from_url,
                                'from_addr' => $contact['addr'],
                                'sparkle' => $sparkle,
-                               'from_photo' => proxy_url($from_photo, false, PROXY_SIZE_THUMB),
+                               'from_photo' => ProxyUtils::proxifyUrl($from_photo, false, ProxyUtils::SIZE_THUMB),
                                'subject' => $subject_e,
                                'body' => $body_e,
                                'delete' => L10n::t('Delete message'),
@@ -487,9 +488,9 @@ function render_messages(array $msg, $t)
                        '$id' => $rr['id'],
                        '$from_name' => $participants,
                        '$from_url' => Contact::magicLink($rr['url']),
-                       '$from_addr' => $contact['addr'],
+                       '$from_addr' => defaults($contact, 'addr', ''),
                        '$sparkle' => ' sparkle',
-                       '$from_photo' => proxy_url($from_photo, false, PROXY_SIZE_THUMB),
+                       '$from_photo' => ProxyUtils::proxifyUrl($from_photo, false, ProxyUtils::SIZE_THUMB),
                        '$subject' => $subject_e,
                        '$delete' => L10n::t('Delete conversation'),
                        '$body' => $body_e,