From c9e5609cbfd89db35b536a22eb2ce6cbf7992783 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 25 Apr 2012 05:41:32 -0700 Subject: bug #307, explaining decentralised private photos is impossible. --- mod/message.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'mod') diff --git a/mod/message.php b/mod/message.php index 260f4bb14..dbca45930 100644 --- a/mod/message.php +++ b/mod/message.php @@ -313,6 +313,29 @@ function message_content(&$a) { $from_url = $a->get_baseurl(true) . '/redir/' . $message['contact-id']; $sparkle = ' sparkle'; } + + + $Text = $message['body']; + $saved_image = ''; + $img_start = strpos($Text,'[img]data:'); + $img_end = strpos($Text,'[/img]'); + + if($img_start !== false && $img_end !== false && $img_end > $img_start) { + $start_fragment = substr($Text,0,$img_start); + $img_start += strlen('[img]'); + $saved_image = substr($Text,$img_start,$img_end - $img_start); + $end_fragment = substr($Text,$img_end + strlen('[/img]')); + $Text = $start_fragment . '[!#saved_image#!]' . $end_fragment; + $search = '/\[url\=(.*?)\]\[!#saved_image#!\]\[\/url\]' . '/is'; + $replace = '[url=' . z_path() . '/redir/' . $message['contact-id'] + . '?f=1&url=' . '$1' . '][!#saved_image#!][/url]' ; + + $Text = preg_replace($search,$replace,$Text); + + if(strlen($saved_image)) + $message['body'] = str_replace('[!#saved_image#!]', '[img]' . $saved_image . '[/img]',$Text); + } + $mails[] = array( 'id' => $message['id'], 'from_name' => template_escape($message['from-name']), -- cgit v1.2.3 From 77a0570162aa00bc9695bd7c15636ae56337a0f5 Mon Sep 17 00:00:00 2001 From: tommy tomson Date: Thu, 26 Apr 2012 17:21:27 +0200 Subject: add link "remove account" to /mod/settings.php --- mod/settings.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mod') diff --git a/mod/settings.php b/mod/settings.php index 8c8b3062d..3072d3d65 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -75,6 +75,11 @@ EOT; 'label' => t('Export personal data'), 'url' => $a->get_baseurl(true) . '/uexport', 'selected' => '' + ), + array( + 'label' => t('Remove account'), + 'url' => $a->get_baseurl(true) . '/removeme', + 'selected' => '' ) ); -- cgit v1.2.3