From d9e4f634665ec4da69b5af230f45f2a0e9688a1b Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 14 Feb 2014 13:15:02 -0800 Subject: preserve attachments when editing a post --- mod/editpost.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mod') diff --git a/mod/editpost.php b/mod/editpost.php index 918a70d36..8c4117e7a 100644 --- a/mod/editpost.php +++ b/mod/editpost.php @@ -92,6 +92,15 @@ function editpost_content(&$a) { } + if($itm[0]['attach']) { + $j = json_decode($itm[0]['attach'],true); + if($j) { + foreach($j as $jj) { + $itm[0]['body'] .= "\n" . '[attachment]' . basename($jj['href']) . ',' . $jj['revision'] . '[/attachment]' . "\n"; + } + } + } + $cipher = get_pconfig(get_app()->profile['profile_uid'],'system','default_cipher'); if(! $cipher) $cipher = 'aes256'; -- cgit v1.2.3