]> git.mxchange.org Git - friendica.git/commitdiff
Fixes for E_NOTICE in editpost.php (#5480)
authorRoland Häder <Quix0r@users.noreply.github.com>
Tue, 24 Jul 2018 11:47:25 +0000 (13:47 +0200)
committerHypolite Petovan <mrpetovan@eml.cc>
Tue, 24 Jul 2018 11:47:25 +0000 (07:47 -0400)
* Added missing columns 'wall' and 'post-type'.

* Convention:
- curly brace after a a method/function declaration belongs to next line
- added space for better readability

mod/editpost.php

index d142d3b2fb7928ee30aadf12582ad2f11c46beb2..258585ef1c3b95cba2e9e1914bcde84014e19100 100644 (file)
@@ -11,8 +11,8 @@ use Friendica\Core\System;
 use Friendica\Model\Item;
 use Friendica\Database\DBA;
 
-function editpost_content(App $a) {
-
+function editpost_content(App $a)
+{
        $o = '';
 
        if (!local_user()) {
@@ -28,8 +28,10 @@ function editpost_content(App $a) {
        }
 
        $fields = ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid',
-               'type', 'body', 'title', 'file'];
+               'type', 'body', 'title', 'file', 'wall', 'post-type'];
+
        $item = Item::selectFirstForUser(local_user(), $fields, ['id' => $post_id, 'uid' => local_user()]);
+
        if (!DBA::isResult($item)) {
                notice(L10n::t('Item not found') . EOL);
                return;
@@ -69,7 +71,7 @@ function editpost_content(App $a) {
        $jotplugins = '';
        $jotnets = '';
 
-       $mail_disabled = ((function_exists('imap_open') && !Config::get('system','imap_disabled')) ? 0 : 1);
+       $mail_disabled = ((function_exists('imap_open') && !Config::get('system', 'imap_disabled')) ? 0 : 1);
 
        $mail_enabled = false;
        $pubmail_enabled = false;
@@ -78,8 +80,10 @@ function editpost_content(App $a) {
                $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1",
                        intval(local_user())
                );
+
                if (DBA::isResult($r)) {
                        $mail_enabled = true;
+
                        if (intval($r[0]['pubmail'])) {
                                $pubmail_enabled = true;
                        }