]> git.mxchange.org Git - friendica.git/blobdiff - mod/editpost.php
Merge pull request #5773 from MrPetovan/task/rewrite-js-hooks
[friendica.git] / mod / editpost.php
index b8ccff470e5fd2fd7dc1873899bcaca4e1d25acb..d6493b3c0c1a8aa34f4d9c547ca1688fe3ca8759 100644 (file)
@@ -21,12 +21,18 @@ function editpost_content(App $a)
        }
 
        $post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
+       $return_url = (($a->argc > 2) ? base64_decode($a->argv[2]) : '');
 
        if (!$post_id) {
                notice(L10n::t('Item not found') . EOL);
                return;
        }
 
+       // Fallback to SESSION return_path
+       if (empty($return_url)) {
+               $return_url = $_SESSION['return_url'];
+       }
+
        $fields = ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid',
                'type', 'body', 'title', 'file', 'wall', 'post-type'];
 
@@ -86,7 +92,7 @@ function editpost_content(App $a)
 
        $o .= replace_macros($tpl, [
                '$is_edit' => true,
-               '$return_path' => $_SESSION['return_url'],
+               '$return_path' => $return_url,
                '$action' => 'item',
                '$share' => L10n::t('Save'),
                '$upload' => L10n::t('Upload photo'),