]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #8007 from MrPetovan/task/7984-add-profile-url-search
authorMichael Vogel <icarus@dabo.de>
Fri, 27 Dec 2019 01:19:39 +0000 (02:19 +0100)
committerGitHub <noreply@github.com>
Fri, 27 Dec 2019 01:19:39 +0000 (02:19 +0100)
Add profile url search

12 files changed:
mod/events.php
mod/photos.php
mod/profiles.php
src/Content/Text/HTML.php
src/Database/DBA.php
src/Model/APContact.php
src/Model/Contact.php
src/Module/Group.php
src/Object/Post.php
src/Util/Logger/StreamLogger.php
view/lang/ja/messages.po
view/lang/ja/strings.php

index 5a5a22d3186bd194a079dc407966a30c7e7ef472..5e129aaf6105b8936b8e4e09e4dfdd52e0017146 100644 (file)
@@ -437,7 +437,7 @@ function events_content(App $a)
                if (!empty($_REQUEST['nofinish']))    {$orig_event['nofinish']    = $_REQUEST['nofinish'];}
                if (!empty($_REQUEST['adjust']))      {$orig_event['adjust']      = $_REQUEST['adjust'];}
                if (!empty($_REQUEST['summary']))     {$orig_event['summary']     = $_REQUEST['summary'];}
-               if (!empty($_REQUEST['description'])) {$orig_event['description'] = $_REQUEST['description'];}
+               if (!empty($_REQUEST['desc']))        {$orig_event['desc']        = $_REQUEST['desc'];}
                if (!empty($_REQUEST['location']))    {$orig_event['location']    = $_REQUEST['location'];}
                if (!empty($_REQUEST['start']))       {$orig_event['start']       = $_REQUEST['start'];}
                if (!empty($_REQUEST['finish']))      {$orig_event['finish']      = $_REQUEST['finish'];}
@@ -445,9 +445,9 @@ function events_content(App $a)
                $n_checked = (!empty($orig_event['nofinish']) ? ' checked="checked" ' : '');
                $a_checked = (!empty($orig_event['adjust'])   ? ' checked="checked" ' : '');
 
-               $t_orig = !empty($orig_event) ? $orig_event['summary']  : '';
-               $d_orig = !empty($orig_event) ? $orig_event['desc']     : '';
-               $l_orig = !empty($orig_event) ? $orig_event['location'] : '';
+               $t_orig = $orig_event['summary']  ?? '';
+               $d_orig = $orig_event['desc']     ?? '';
+               $l_orig = $orig_event['location'] ?? '';
                $eid = !empty($orig_event) ? $orig_event['id']  : 0;
                $cid = !empty($orig_event) ? $orig_event['cid'] : 0;
                $uri = !empty($orig_event) ? $orig_event['uri'] : '';
index 2f3e7d3117cde88b03989d9ac16dde3411ae5429..1d7ce7b3deda0c136457e3afa619baa070857215 100644 (file)
@@ -1035,14 +1035,10 @@ function photos_content(App $a)
                if ($cmd === 'drop') {
                        $drop_url = $a->query_string;
 
-                       $extra_inputs = [
-                               ['name' => 'albumname', 'value' => $_POST['albumname']],
-                       ];
-
                        return Renderer::replaceMacros(Renderer::getMarkupTemplate('confirm.tpl'), [
                                '$method' => 'post',
                                '$message' => L10n::t('Do you really want to delete this photo album and all its photos?'),
-                               '$extra_inputs' => $extra_inputs,
+                               '$extra_inputs' => [],
                                '$confirm' => L10n::t('Delete Album'),
                                '$confirm_url' => $drop_url,
                                '$confirm_name' => 'dropalbum',
index 72bcac49fc0b6ebf7760111a069f67d8dca16428..d3a6c3e38a41d6e3da56d1c95408f55b4afd351d 100644 (file)
@@ -207,7 +207,7 @@ function profiles_post(App $a) {
                        return;
                }
 
-               $dob = $_POST['dob'] ? Strings::escapeHtml(trim($_POST['dob'])) : '0000-00-00';
+               $dob = !empty($_POST['dob']) ? Strings::escapeHtml(trim($_POST['dob'])) : '0000-00-00';
 
                $y = substr($dob, 0, 4);
                if ((! ctype_digit($y)) || ($y < 1900)) {
@@ -238,17 +238,17 @@ function profiles_post(App $a) {
                        $namechanged = true;
                }
 
-               $pdesc = Strings::escapeTags(trim($_POST['pdesc']));
-               $gender = Strings::escapeTags(trim($_POST['gender']));
-               $address = Strings::escapeTags(trim($_POST['address']));
-               $locality = Strings::escapeTags(trim($_POST['locality']));
-               $region = Strings::escapeTags(trim($_POST['region']));
-               $postal_code = Strings::escapeTags(trim($_POST['postal_code']));
-               $country_name = Strings::escapeTags(trim($_POST['country_name']));
-               $pub_keywords = profile_clean_keywords(Strings::escapeTags(trim($_POST['pub_keywords'])));
-               $prv_keywords = profile_clean_keywords(Strings::escapeTags(trim($_POST['prv_keywords'])));
-               $marital = Strings::escapeTags(trim($_POST['marital']));
-               $howlong = Strings::escapeTags(trim($_POST['howlong']));
+               $pdesc = Strings::escapeTags(trim($_POST['pdesc'] ?? ''));
+               $gender = Strings::escapeTags(trim($_POST['gender'] ?? ''));
+               $address = Strings::escapeTags(trim($_POST['address'] ?? ''));
+               $locality = Strings::escapeTags(trim($_POST['locality'] ?? ''));
+               $region = Strings::escapeTags(trim($_POST['region'] ?? ''));
+               $postal_code = Strings::escapeTags(trim($_POST['postal_code'] ?? ''));
+               $country_name = Strings::escapeTags(trim($_POST['country_name'] ?? ''));
+               $pub_keywords = profile_clean_keywords(Strings::escapeTags(trim($_POST['pub_keywords'] ?? '')));
+               $prv_keywords = profile_clean_keywords(Strings::escapeTags(trim($_POST['prv_keywords'] ?? '')));
+               $marital = Strings::escapeTags(trim($_POST['marital'] ?? ''));
+               $howlong = Strings::escapeTags(trim($_POST['howlong'] ?? ''));
 
                $with = (!empty($_POST['with']) ? Strings::escapeTags(trim($_POST['with'])) : '');
 
@@ -338,7 +338,7 @@ function profiles_post(App $a) {
 
                $hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0);
 
-               PConfig::set(local_user(), 'system', 'detailled_profile', (($_POST['detailed_profile'] == 1) ? 1: 0));
+               PConfig::set(local_user(), 'system', 'detailled_profile', !empty($_POST['detailed_profile']) ? 1: 0);
 
                $changes = [];
                if ($is_default) {
index 390a97f0f575dce34a4a4bab3150a467dfede47a..8a54c26a7ca8433a15abb958a015cb33f716eb68 100644 (file)
@@ -290,19 +290,10 @@ class HTML
 
                self::tagToBBCode($doc, 'hr', [], "[hr]", "");
 
-               self::tagToBBCode($doc, 'table', [], "", "");
-               self::tagToBBCode($doc, 'tr', [], "\n", "");
-               self::tagToBBCode($doc, 'td', [], "\t", "");
-               //self::node2BBCode($doc, 'table', array(), "[table]", "[/table]");
-               //self::node2BBCode($doc, 'th', array(), "[th]", "[/th]");
-               //self::node2BBCode($doc, 'tr', array(), "[tr]", "[/tr]");
-               //self::node2BBCode($doc, 'td', array(), "[td]", "[/td]");
-               //self::node2BBCode($doc, 'h1', array(), "\n\n[size=xx-large][b]", "[/b][/size]\n");
-               //self::node2BBCode($doc, 'h2', array(), "\n\n[size=x-large][b]", "[/b][/size]\n");
-               //self::node2BBCode($doc, 'h3', array(), "\n\n[size=large][b]", "[/b][/size]\n");
-               //self::node2BBCode($doc, 'h4', array(), "\n\n[size=medium][b]", "[/b][/size]\n");
-               //self::node2BBCode($doc, 'h5', array(), "\n\n[size=small][b]", "[/b][/size]\n");
-               //self::node2BBCode($doc, 'h6', array(), "\n\n[size=x-small][b]", "[/b][/size]\n");
+               self::tagToBBCode($doc, 'table', [], "[table]", "[/table]");
+               self::tagToBBCode($doc, 'th', [], "[th]", "[/th]");
+               self::tagToBBCode($doc, 'tr', [], "[tr]", "[/tr]");
+               self::tagToBBCode($doc, 'td', [], "[td]", "[/td]");
 
                self::tagToBBCode($doc, 'h1', [], "[h1]", "[/h1]");
                self::tagToBBCode($doc, 'h2', [], "[h2]", "[/h2]");
index befb65bf9a904f1a31241d3b4c3c1e16b7940626..593ca0e5074e439492163f1f35d706b1b73ad5e6 100644 (file)
@@ -543,33 +543,38 @@ class DBA extends BaseObject
                                                $condition_string .= " AND ";
                                        }
                                        if (is_array($value)) {
-                                               /* Workaround for MySQL Bug #64791.
-                                                * Never mix data types inside any IN() condition.
-                                                * In case of mixed types, cast all as string.
-                                                * Logic needs to be consistent with DBA::p() data types.
-                                                */
-                                               $is_int = false;
-                                               $is_alpha = false;
-                                               foreach ($value as $single_value) {
-                                                       if (is_int($single_value)) {
-                                                               $is_int = true;
-                                                       } else {
-                                                               $is_alpha = true;
+                                               if (count($value)) {
+                                                       /* Workaround for MySQL Bug #64791.
+                                                        * Never mix data types inside any IN() condition.
+                                                        * In case of mixed types, cast all as string.
+                                                        * Logic needs to be consistent with DBA::p() data types.
+                                                        */
+                                                       $is_int = false;
+                                                       $is_alpha = false;
+                                                       foreach ($value as $single_value) {
+                                                               if (is_int($single_value)) {
+                                                                       $is_int = true;
+                                                               } else {
+                                                                       $is_alpha = true;
+                                                               }
                                                        }
-                                               }
 
-                                               if ($is_int && $is_alpha) {
-                                                       foreach ($value as &$ref) {
-                                                               if (is_int($ref)) {
-                                                                       $ref = (string)$ref;
+                                                       if ($is_int && $is_alpha) {
+                                                               foreach ($value as &$ref) {
+                                                                       if (is_int($ref)) {
+                                                                               $ref = (string)$ref;
+                                                                       }
                                                                }
+                                                               unset($ref); //Prevent accidental re-use.
                                                        }
-                                                       unset($ref); //Prevent accidental re-use.
-                                               }
 
-                                               $new_values = array_merge($new_values, array_values($value));
-                                               $placeholders = substr(str_repeat("?, ", count($value)), 0, -2);
-                                               $condition_string .= self::quoteIdentifier($field) . " IN (" . $placeholders . ")";
+                                                       $new_values = array_merge($new_values, array_values($value));
+                                                       $placeholders = substr(str_repeat("?, ", count($value)), 0, -2);
+                                                       $condition_string .= self::quoteIdentifier($field) . " IN (" . $placeholders . ")";
+                                               } else {
+                                                       // Empty value array isn't supported by IN and is logically equivalent to no match
+                                                       $condition_string .= "FALSE";
+                                               }
                                        } elseif (is_null($value)) {
                                                $condition_string .= self::quoteIdentifier($field) . " IS NULL";
                                        } else {
index e3c3a0a12b2f09fc51c7ca403e6f2c4ac91a0c65..c535034487c2946a7e61d9be573280af5655f7c0 100644 (file)
@@ -192,6 +192,7 @@ class APContact extends BaseObject
                        $apcontact['addr'] = '';
                }
 
+               $apcontact['pubkey'] = null;
                if (!empty($compacted['w3id:publicKey'])) {
                        $apcontact['pubkey'] = trim(JsonLD::fetchElement($compacted['w3id:publicKey'], 'w3id:publicKeyPem', '@value'));
                }
index 534c99d465e4453d784cd2aedd1b941d62faa263..6c0436eea2b84845b46a311630f998f08a181fe2 100644 (file)
@@ -406,11 +406,6 @@ class Contact extends BaseObject
                }
 
                DBA::update('user-contact', ['blocked' => $blocked], ['cid' => $cdata['public'], 'uid' => $uid], true);
-
-               if ($blocked) {
-                       // Blocked contact can't be in any group
-                       self::removeFromGroups($cid);
-               }
        }
 
        /**
index 4c7672c01a7285d855547028cfb8072f7fd9c0be..5699d2d30bf87d586477ec66b33e79520cc95bf2 100644 (file)
@@ -87,34 +87,28 @@ class Group extends BaseModule
                                        throw new \Exception(L10n::t('Unknown group.'), 404);
                                }
 
-                               $contact = DBA::selectFirst('contact', ['pending', 'blocked', 'deleted'], ['id' => $contact_id, 'uid' => local_user()]);
+                               $contact = DBA::selectFirst('contact', ['deleted'], ['id' => $contact_id, 'uid' => local_user()]);
                                if (!DBA::isResult($contact)) {
                                        throw new \Exception(L10n::t('Contact not found.'), 404);
                                }
 
-                               if ($contact['pending']) {
-                                       throw new \Exception(L10n::t('Contact is unavailable.'), 400);
-                               }
-
                                if ($contact['deleted']) {
                                        throw new \Exception(L10n::t('Contact is deleted.'), 410);
                                }
 
                                switch($command) {
                                        case 'add':
-                                               if ($contact['blocked']) {
-                                                       throw new \Exception(L10n::t('Contact is blocked, unable to add it to a group.'), 400);
-                                               }
-
                                                if (!Model\Group::addMember($group_id, $contact_id)) {
                                                        throw new \Exception(L10n::t('Unable to add the contact to the group.'), 500);
                                                }
+
                                                $message = L10n::t('Contact successfully added to group.');
                                                break;
                                        case 'remove':
                                                if (!Model\Group::removeMember($group_id, $contact_id)) {
                                                        throw new \Exception(L10n::t('Unable to remove the contact from the group.'), 500);
                                                }
+
                                                $message = L10n::t('Contact successfully removed from group.');
                                                break;
                                        default:
index 2c4e841acbdd5592e58e72c416e63381d14f0a4f..acd0663504dc263a9a419454e22534f896ff9f70 100644 (file)
@@ -420,7 +420,7 @@ class Post extends BaseObject
                        'localtime'       => DateTimeFormat::local($item['created'], 'r'),
                        'ago'             => $item['app'] ? L10n::t('%s from %s', $ago, $item['app']) : $ago,
                        'app'             => $item['app'],
-                       'created'         => Temporal::getRelativeDate($item['created']),
+                       'created'         => $ago,
                        'lock'            => $lock,
                        'location'        => $location_e,
                        'indent'          => $indent,
index 7485e750b844783d116ab22586a5b88f591f0546..9b7aa0890b0a79c4ba25b9afc71d7d3996d44f5c 100644 (file)
@@ -138,7 +138,7 @@ class StreamLogger extends AbstractLogger
                $record = array_merge($record, ['uid' => $this->logUid, 'process_id' => $this->pid]);
                $logMessage = '';
 
-               $logMessage .= DateTimeFormat::utcNow() . ' ';
+               $logMessage .= DateTimeFormat::utcNow(DateTimeFormat::ATOM) . ' ';
                $logMessage .= $this->channel . ' ';
                $logMessage .= '[' . strtoupper($level) . ']: ';
                $logMessage .= $this->psrInterpolate($message, $context) . ' ';
index b3d54bae1196c1eb30ce79eb7c889bcd0dd009b3..01f6429156ede15598577f36fc13cc61ff56e0ff 100644 (file)
@@ -11,7 +11,7 @@ msgstr ""
 "Project-Id-Version: friendica\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2019-12-05 23:28+0100\n"
-"PO-Revision-Date: 2019-12-20 02:40+0000\n"
+"PO-Revision-Date: 2019-12-23 07:57+0000\n"
 "Last-Translator: ozero dien <rgfx0020+misc@gmail.com>\n"
 "Language-Team: Japanese (http://www.transifex.com/Friendica/friendica/language/ja/)\n"
 "MIME-Version: 1.0\n"
@@ -3128,7 +3128,7 @@ msgstr "フォロー解除"
 
 #: src/Model/Contact.php:1260
 msgid "Drop Contact"
-msgstr "コンタクトをドロップ"
+msgstr "コンタクトを削除"
 
 #: src/Model/Contact.php:1270 src/Module/Admin/Users.php:286
 #: mod/notifications.php:198 mod/notifications.php:292
@@ -8802,21 +8802,21 @@ msgstr "接続は双方向ですか?"
 msgid ""
 "Accepting %s as a friend allows %s to subscribe to your posts, and you will "
 "also receive updates from them in your news feed."
-msgstr "受け入れ%s友人などができます%sあなたの記事を購読すると、あなたもあなたのニュースフィードにそれらから更新を受信します。"
+msgstr "%s を友達として受け入れた場合、%s はあなたの投稿を購読できます。また、あなたのニュースフィードに彼らの投稿が表示されます。"
 
 #: mod/notifications.php:222
 #, php-format
 msgid ""
 "Accepting %s as a subscriber allows them to subscribe to your posts, but you"
 " will not receive updates from them in your news feed."
-msgstr "購読者として%sを受け入れると、投稿を購読できますが、ニュースフィードでそれらから更新を受け取ることはできません。"
+msgstr "%sを購読者として受け入れると、彼らはあなたの投稿を購読できますが、あなたのニュースフィードに彼らの投稿は表示されません。"
 
 #: mod/notifications.php:226
 #, php-format
 msgid ""
 "Accepting %s as a sharer allows them to subscribe to your posts, but you "
 "will not receive updates from them in your news feed."
-msgstr "共有者として%sを受け入れると、彼らはあなたの投稿を購読できますが、ニュースフィードでそれらから更新を受け取ることはできません。"
+msgstr "%sを共有者として受け入れると、彼らはあなたの投稿を購読できますが、あなたのニュースフィードに彼らの投稿は表示されません。"
 
 #: mod/notifications.php:237
 msgid "Friend"
@@ -9234,7 +9234,7 @@ msgstr "アルバムを編集"
 
 #: mod/photos.php:1074
 msgid "Drop Album"
-msgstr "ã\83\89ã\83­ã\83\83ã\83\97ã\82¢ã\83«ã\83\90ã\83 "
+msgstr "ã\82¢ã\83«ã\83\90ã\83 ã\82\92å\89\8aé\99¤"
 
 #: mod/photos.php:1079
 msgid "Show Newest First"
index 671da529aa1c322fdb3f24e1fe42db353d4697ee..db7193ed021806391a65dda144f11293deac85c1 100644 (file)
@@ -720,7 +720,7 @@ $a->strings["Group Name: "] = "グループ名:";
 $a->strings["Edit groups"] = "グループを編集";
 $a->strings["Item filed"] = "提出されたアイテム";
 $a->strings["UnFollow"] = "フォロー解除";
-$a->strings["Drop Contact"] = "コンタクトをドロップ";
+$a->strings["Drop Contact"] = "コンタクトを削除";
 $a->strings["Approve"] = "承認する";
 $a->strings["Organisation"] = "組織";
 $a->strings["News"] = "ニュース";
@@ -1954,9 +1954,9 @@ $a->strings["Claims to be known to you: "] = "あなたに知られていると
 $a->strings["yes"] = "はい";
 $a->strings["no"] = "いや";
 $a->strings["Shall your connection be bidirectional or not?"] = "接続は双方向ですか?";
-$a->strings["Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed."] = "受け入れ%s友人などができます%sあなたの記事を購読すると、あなたもあなたのニュースフィードにそれらから更新を受信します。";
-$a->strings["Accepting %s as a subscriber allows them to subscribe to your posts, but you will not receive updates from them in your news feed."] = "購読者として%sを受け入れると、投稿を購読できますが、ニュースフィードでそれらから更新を受け取ることはできません。";
-$a->strings["Accepting %s as a sharer allows them to subscribe to your posts, but you will not receive updates from them in your news feed."] = "共有者として%sを受け入れると、彼らはあなたの投稿を購読できますが、ニュースフィードでそれらから更新を受け取ることはできません。";
+$a->strings["Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed."] = "%s を友達として受け入れた場合、%s はあなたの投稿を購読できます。また、あなたのニュースフィードに彼らの投稿が表示されます。";
+$a->strings["Accepting %s as a subscriber allows them to subscribe to your posts, but you will not receive updates from them in your news feed."] = "%sを購読者として受け入れると、彼らはあなたの投稿を購読できますが、あなたのニュースフィードに彼らの投稿は表示されません。";
+$a->strings["Accepting %s as a sharer allows them to subscribe to your posts, but you will not receive updates from them in your news feed."] = "%sを共有者として受け入れると、彼らはあなたの投稿を購読できますが、あなたのニュースフィードに彼らの投稿は表示されません。";
 $a->strings["Friend"] = "ともだち";
 $a->strings["Sharer"] = "共有者";
 $a->strings["Subscriber"] = "加入者";
@@ -2057,7 +2057,7 @@ $a->strings["Show to Contacts"] = "コンタクトに表示";
 $a->strings["Do you really want to delete this photo album and all its photos?"] = "このフォトアルバムとそのすべての写真を本当に削除しますか?";
 $a->strings["Delete Album"] = "アルバムを削除";
 $a->strings["Edit Album"] = "アルバムを編集";
-$a->strings["Drop Album"] = "ã\83\89ã\83­ã\83\83ã\83\97ã\82¢ã\83«ã\83\90ã\83 ";
+$a->strings["Drop Album"] = "ã\82¢ã\83«ã\83\90ã\83 ã\82\92å\89\8aé\99¤";
 $a->strings["Show Newest First"] = "最新を最初に表示";
 $a->strings["Show Oldest First"] = "最も古いものを最初に表示";
 $a->strings["View Photo"] = "写真を見る";