]> git.mxchange.org Git - friendica.git/blobdiff - mod/item.php
Merge pull request #11005 from nupplaphil/feat/module_di
[friendica.git] / mod / item.php
index f40f6ad45d30fb37f3851f55b8bbf7bed8ac8d10..da3eb16c3087b9e0982a6dc238865de3b60bc3df 100644 (file)
@@ -352,7 +352,8 @@ function item_post(App $a) {
                $filedas = FileTag::fileToArray($categories);
        }
 
-       $categories = FileTag::listToFile(trim($_REQUEST['category'] ?? ''), 'category');
+       $list_array = explode(',', trim($_REQUEST['category'] ?? ''));
+       $categories = FileTag::arrayToFile($list_array, 'category');
 
        if (!empty($filedas) && is_array($filedas)) {
                // append the fileas stuff to the new categories list
@@ -686,7 +687,7 @@ function item_post(App $a) {
        Hook::callAll('post_local',$datarray);
 
        if (!empty($_REQUEST['scheduled_at'])) {
-               $scheduled_at = DateTimeFormat::convert($_REQUEST['scheduled_at'], 'UTC', $a->getTimezone());
+               $scheduled_at = DateTimeFormat::convert($_REQUEST['scheduled_at'], 'UTC', $a->getTimeZone());
                if ($scheduled_at > DateTimeFormat::utcNow()) {
                        unset($datarray['created']);
                        unset($datarray['edited']);
@@ -777,7 +778,7 @@ function item_post(App $a) {
        // These notifications are sent if someone else is commenting other your wall
        if ($contact_record != $author) {
                if ($toplevel_item_id) {
-                       notification([
+                       DI::notify()->createFromArray([
                                'type'  => Notification\Type::COMMENT,
                                'otype' => Notification\ObjectType::ITEM,
                                'verb'  => Activity::POST,
@@ -787,7 +788,7 @@ function item_post(App $a) {
                                'link'  => DI::baseUrl() . '/display/' . urlencode($datarray['guid']),
                        ]);
                } elseif (empty($forum_contact)) {
-                       notification([
+                       DI::notify()->createFromArray([
                                'type'  => Notification\Type::WALL,
                                'otype' => Notification\ObjectType::ITEM,
                                'verb'  => Activity::POST,