aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Editpost.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Module/Editpost.php')
-rw-r--r--Zotlabs/Module/Editpost.php21
1 files changed, 12 insertions, 9 deletions
diff --git a/Zotlabs/Module/Editpost.php b/Zotlabs/Module/Editpost.php
index c6cfc6dc4..b21c58af2 100644
--- a/Zotlabs/Module/Editpost.php
+++ b/Zotlabs/Module/Editpost.php
@@ -57,15 +57,17 @@ class Editpost extends \Zotlabs\Web\Controller {
$catsenabled = ((feature_enabled($owner_uid,'categories')) ? 'categories' : '');
if ($catsenabled){
- $itm = fetch_post_tags($itm);
-
- $cats = get_terms_oftype($itm[0]['term'], TERM_CATEGORY);
-
- foreach ($cats as $cat) {
- if (strlen($category))
- $category .= ', ';
- $category .= $cat['term'];
- }
+ $itm = fetch_post_tags($itm);
+ if (isset($itm[0]['term'])) {
+ $cats = get_terms_oftype($itm[0]['term'], TERM_CATEGORY);
+ if ($cats) {
+ foreach ($cats as $cat) {
+ if (strlen($category))
+ $category .= ', ';
+ $category .= $cat['term'];
+ }
+ }
+ }
}
if($itm[0]['attach']) {
@@ -104,6 +106,7 @@ class Editpost extends \Zotlabs\Web\Controller {
'bbcode' => true
);
+ $a = '';
$editor = status_editor($a, $x, false, 'Editpost');
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(