diff options
author | Mario <mario@mariovavti.com> | 2022-10-20 13:16:03 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2022-10-20 13:16:03 +0000 |
commit | bf434818d7cfac6bf29482d4bb07fc567de2fc90 (patch) | |
tree | fc50a3cafce38134d758767caec1ffea8da8fdcf /Zotlabs/Module/Editpost.php | |
parent | 03aeb888322e792ccb17593761f1f93ad2906c7e (diff) | |
download | volse-hubzilla-bf434818d7cfac6bf29482d4bb07fc567de2fc90.tar.gz volse-hubzilla-bf434818d7cfac6bf29482d4bb07fc567de2fc90.tar.bz2 volse-hubzilla-bf434818d7cfac6bf29482d4bb07fc567de2fc90.zip |
fix php warnings
Diffstat (limited to 'Zotlabs/Module/Editpost.php')
-rw-r--r-- | Zotlabs/Module/Editpost.php | 21 |
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( |