]> git.mxchange.org Git - friendica.git/commitdiff
Reformatted code
authorMichael <heluecht@pirati.ca>
Mon, 6 Mar 2023 06:15:30 +0000 (06:15 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 6 Mar 2023 06:15:30 +0000 (06:15 +0000)
src/Content/Item.php
src/Content/Text/BBCode.php

index 58fe945d3249c1d25171f94d4b4d1b678c6a0d1c..25d27b26df7b0228e88681d4d0a627d87812f213 100644 (file)
@@ -223,19 +223,13 @@ class Item
 
                                // select someone by nick in the current network
                                if (!DBA::isResult($contact) && ($network != '')) {
-                                       $condition = [
-                                               "`nick` = ? AND `network` = ? AND `uid` = ?",
-                                               $name, $network, $profile_uid
-                                       ];
+                                       $condition = ['nick' => $name, 'network' => $network, 'uid' => $profile_uid];
                                        $contact = DBA::selectFirst('contact', $fields, $condition);
                                }
 
                                // select someone by attag in the current network
                                if (!DBA::isResult($contact) && ($network != '')) {
-                                       $condition = [
-                                               "`attag` = ? AND `network` = ? AND `uid` = ?",
-                                               $name, $network, $profile_uid
-                                       ];
+                                       $condition = ['attag' => $name, 'network' => $network, 'uid' => $profile_uid];
                                        $contact = DBA::selectFirst('contact', $fields, $condition);
                                }
 
@@ -247,13 +241,13 @@ class Item
 
                                // select someone by nick in any network
                                if (!DBA::isResult($contact)) {
-                                       $condition = ["`nick` = ? AND `uid` = ?", $name, $profile_uid];
+                                       $condition = ['nick' => $name, 'uid' => $profile_uid];
                                        $contact = DBA::selectFirst('contact', $fields, $condition);
                                }
 
                                // select someone by attag in any network
                                if (!DBA::isResult($contact)) {
-                                       $condition = ["`attag` = ? AND `uid` = ?", $name, $profile_uid];
+                                       $condition = ['attag' => $name, 'uid' => $profile_uid];
                                        $contact = DBA::selectFirst('contact', $fields, $condition);
                                }
 
@@ -339,9 +333,8 @@ class Item
                                        default:
                                                if ($obj['resource-id']) {
                                                        $post_type = $this->l10n->t('photo');
-                                                       $m = [];
-                                                       preg_match("/\[url=([^]]*)\]/", $obj['body'], $m);
-                                                       $rr['plink'] = $m[1];
+                                                       preg_match("/\[url=([^]]*)\]/", $obj['body'], $matches);
+                                                       $rr['plink'] = $matches[1];
                                                } else {
                                                        $post_type = $this->l10n->t('status');
                                                }
index f072e59c9dbcb0c147288765814cbb179fdf42e4..33f91b43d11ed2b3fd31400eca4fcb19e27c9ae3 100644 (file)
@@ -870,8 +870,7 @@ class BBCode
                                        $attributes[$field] = html_entity_decode($matches[2] ?? '', ENT_QUOTES, 'UTF-8');
                                }
 
-                               $img_str = '<img src="' .
-                                       self::proxyUrl($match[2], $simplehtml, $uriid) . '"';
+                               $img_str = '<img src="' . self::proxyUrl($match[2], $simplehtml, $uriid) . '"';
                                foreach ($attributes as $key => $value) {
                                        if (!empty($value)) {
                                                $img_str .= ' ' . $key . '="' . htmlspecialchars($value, ENT_COMPAT) . '"';