}
$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'];
+ 'type', 'body', 'title', 'file', 'wall', 'post-type', 'guid'];
$item = Item::selectFirstForUser(local_user(), $fields, ['id' => $post_id, 'uid' => local_user()]);
$o .= replace_macros($tpl, [
'$is_edit' => true,
- '$return_path' => $return_url,
+ '$return_path' => '/display/' . $item['guid'],
'$action' => 'item',
'$share' => L10n::t('Save'),
'$upload' => L10n::t('Upload photo'),
if ($item["event-id"] != 0) {
$edpost = ["events/event/" . $item['event-id'], L10n::t("Edit")];
} else {
- $edpost = ["editpost/" . $item['id'] . "/" . base64_encode($a->cmd), L10n::t("Edit")];
+ $edpost = ["editpost/" . $item['id'], L10n::t("Edit")];
}
$dropping = in_array($item['uid'], [0, local_user()]);
} else {