]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #5295 from MrPetovan/task/4889-move-config-to-config
authorMichael Vogel <icarus@dabo.de>
Wed, 18 Jul 2018 09:04:35 +0000 (11:04 +0200)
committerGitHub <noreply@github.com>
Wed, 18 Jul 2018 09:04:35 +0000 (11:04 +0200)
Move configuration to config/

mod/item.php
src/Content/OEmbed.php
src/Content/Text/BBCode.php
src/Model/Item.php

index dbe396e901d9ccf19ca2735971bd9e90a2fc81f0..d075d611a4ab3710fe1b04ecbb95ebe37a69844e 100644 (file)
@@ -158,29 +158,32 @@ function item_post(App $a) {
        // Now check that valid personal details have been provided
        if (!can_write_wall($profile_uid) && !$allow_comment) {
                notice(L10n::t('Permission denied.') . EOL) ;
+
                if (x($_REQUEST, 'return')) {
                        goaway($return_path);
                }
+
                killme();
        }
 
-
-       // is this an edited post?
-
+       // Init post instance
        $orig_post = null;
 
-       if ($post_id) {
+       // is this an edited post?
+       if ($post_id > 0) {
                $orig_post = Item::selectFirst(Item::ITEM_FIELDLIST, ['id' => $post_id]);
        }
 
        $user = dba::selectFirst('user', [], ['uid' => $profile_uid]);
+
        if (!DBM::is_result($user) && !$parent) {
                return;
        }
 
        $categories = '';
+       $postopts = '';
 
-       if ($orig_post) {
+       if (!empty($orig_post)) {
                $str_group_allow   = $orig_post['allow_gid'];
                $str_contact_allow = $orig_post['allow_cid'];
                $str_group_deny    = $orig_post['deny_gid'];
index 360a0dc4899439949d7addf0de0b99bcf088d469..390f3ea868435a3c035d9f9f7e9deceab24f5fec 100644 (file)
@@ -20,6 +20,7 @@ use DOMNode;
 use DOMText;
 use DOMXPath;
 use Exception;
+use stdClass;
 
 require_once 'include/dba.php';
 require_once 'mod/proxy.php';
@@ -163,11 +164,12 @@ class OEmbed
                return $j;
        }
 
-       private static function formatObject($j)
+       private static function formatObject(stdClass $j)
        {
                $embedurl = $j->embedurl;
                $jhtml = $j->html;
                $ret = '<div class="oembed ' . $j->type . '">';
+
                switch ($j->type) {
                        case "video":
                                if (isset($j->thumbnail_url)) {
@@ -326,7 +328,7 @@ class OEmbed
 
                $o = self::fetchURL($url, !self::isAllowedURL($url));
 
-               if (!is_object($o) || $o->type == 'error') {
+               if (!is_object($o) || property_exists($o, 'type') && $o->type == 'error') {
                        throw new Exception('OEmbed failed for URL: ' . $url);
                }
 
index 8237714ab6792e7e27edd010a2f0eaa366c0c293..6c21a37cba290aa40b366b6444dac9c6b7d14680 100644 (file)
@@ -545,6 +545,8 @@ class BBCode extends BaseObject
                if (isset($data["title"])) {
                        $data["title"] = strip_tags($data["title"]);
                        $data["title"] = str_replace(["http://", "https://"], "", $data["title"]);
+               } else {
+                       $data["title"] = null;
                }
 
                if (((strpos($data["text"], "[img=") !== false) || (strpos($data["text"], "[img]") !== false) || Config::get('system', 'always_show_preview')) && !empty($data["image"])) {
index d6635407dc75498412f59c651cda1b70d464fe77..0e01ff7b96b5f65fea46e451b1971470f8095464 100644 (file)
@@ -72,7 +72,7 @@ class Item extends BaseObject
                        'title', 'content-warning', 'body', 'location', 'coord', 'app',
                        'rendered-hash', 'rendered-html', 'object-type', 'object', 'target-type', 'target',
                        'author-id', 'author-link', 'author-name', 'author-avatar',
-                       'owner-id', 'owner-link', 'owner-name', 'owner-avatar'];
+                       'owner-id', 'owner-link', 'owner-name', 'owner-avatar', 'emailcc'];
 
        // Never reorder or remove entries from this list. Just add new ones at the end, if needed.
        // The item-activity table only stores the index and needs this array to know the matching activity.