friendica 9 years ago
parent
commit
63f10f6c6b
56 changed files with 383 additions and 77 deletions
  1. +1
    -1
      include/bb2diaspora.php
  2. +71
    -17
      include/bbcode.php
  3. +82
    -20
      include/conversation.php
  4. +146
    -18
      include/items.php
  5. +0
    -0
      include/security.php
  6. +81
    -20
      mod/message.php
  7. +2
    -1
      mod/photos.php
  8. +0
    -0
      util/run_xgettext.sh
  9. +0
    -0
      view/theme/diabook/ch_directory_item.tpl
  10. +0
    -0
      view/theme/diabook/communityhome.tpl
  11. +0
    -0
      view/theme/diabook/contact_template.tpl
  12. +0
    -0
      view/theme/diabook/diabook-aerith/icons/block.png
  13. +0
    -0
      view/theme/diabook/diabook-blue/icons/block.png
  14. +0
    -0
      view/theme/diabook/diabook-dark/icons/block.png
  15. +0
    -0
      view/theme/diabook/diabook-green/icons/block.png
  16. +0
    -0
      view/theme/diabook/diabook-green/icons/notifications3.png
  17. +0
    -0
      view/theme/diabook/diabook-green/icons/notify3.png
  18. +0
    -0
      view/theme/diabook/diabook-pink/icons/block.png
  19. +0
    -0
      view/theme/diabook/diabook-pink/icons/notifications3.png
  20. +0
    -0
      view/theme/diabook/diabook-pink/icons/notify3.png
  21. +0
    -0
      view/theme/diabook/diabook-red/icons/block.png
  22. +0
    -0
      view/theme/diabook/directory_item.tpl
  23. +0
    -0
      view/theme/diabook/group_side.tpl
  24. +0
    -0
      view/theme/diabook/icons/attach.png
  25. +0
    -0
      view/theme/diabook/icons/audio.png
  26. +0
    -0
      view/theme/diabook/icons/block.png
  27. +0
    -0
      view/theme/diabook/icons/camera.png
  28. +0
    -0
      view/theme/diabook/icons/close_box.png
  29. +0
    -0
      view/theme/diabook/icons/contacts2.png
  30. +0
    -0
      view/theme/diabook/icons/drop.png
  31. +0
    -0
      view/theme/diabook/icons/expand.png
  32. +0
    -0
      view/theme/diabook/icons/file_as.png
  33. +0
    -0
      view/theme/diabook/icons/link.png
  34. +0
    -0
      view/theme/diabook/icons/lock.png
  35. +0
    -0
      view/theme/diabook/icons/lupe.png
  36. +0
    -0
      view/theme/diabook/icons/next.png
  37. +0
    -0
      view/theme/diabook/icons/notifications.png
  38. +0
    -0
      view/theme/diabook/icons/notifications3.png
  39. +0
    -0
      view/theme/diabook/icons/notify.png
  40. +0
    -0
      view/theme/diabook/icons/notify3.png
  41. +0
    -0
      view/theme/diabook/icons/pencil.png
  42. +0
    -0
      view/theme/diabook/icons/prev.png
  43. +0
    -0
      view/theme/diabook/icons/recycle.png
  44. +0
    -0
      view/theme/diabook/icons/remote.png
  45. +0
    -0
      view/theme/diabook/icons/scroll_top.png
  46. +0
    -0
      view/theme/diabook/icons/star.png
  47. +0
    -0
      view/theme/diabook/icons/starred.png
  48. +0
    -0
      view/theme/diabook/icons/tagged.png
  49. +0
    -0
      view/theme/diabook/icons/unlock.png
  50. +0
    -0
      view/theme/diabook/icons/unstarred.png
  51. +0
    -0
      view/theme/diabook/icons/video.png
  52. +0
    -0
      view/theme/diabook/icons/weblink.png
  53. +0
    -0
      view/theme/diabook/jot.tpl
  54. +0
    -0
      view/theme/diabook/mail_conv.tpl
  55. +0
    -0
      view/theme/diabook/search_item.tpl
  56. +0
    -0
      view/theme/diabook/theme.php

+ 1
- 1
include/bb2diaspora.php View File

@ -346,7 +346,7 @@ function bb2diaspora($Text,$preserve_nl = false) {
// If we found an event earlier, strip out all the event code and replace with a reformatted version.
if(x($ev,'desc') && x($ev,'start')) {
if(x($ev,'start')) {
$sub = format_event_diaspora($ev);


+ 71
- 17
include/bbcode.php View File

@ -47,6 +47,67 @@ function bb_unspacefy_and_trim($st) {
return $unspacefied;
}
if(! function_exists('bb_extract_images')) {
function bb_extract_images($body) {
$saved_image = array();
$orig_body = $body;
$new_body = '';
$cnt = 0;
$img_start = strpos($orig_body, '[img');
$img_st_close = ($img_start !== false ? strpos(substr($orig_body, $img_start), ']') : false);
$img_end = ($img_start !== false ? strpos(substr($orig_body, $img_start), '[/img]') : false);
while(($img_st_close !== false) && ($img_end !== false)) {
$img_st_close++; // make it point to AFTER the closing bracket
$img_end += $img_start;
if(! strcmp(substr($orig_body, $img_start + $img_st_close, 5), 'data:')) {
// This is an embedded image
$saved_image[$cnt] = substr($orig_body, $img_start + $img_st_close, $img_end - ($img_start + $img_st_close));
$new_body = $new_body . substr($orig_body, 0, $img_start) . '[$#saved_image' . $cnt . '#$]';
$cnt++;
}
else
$new_body = $new_body . substr($orig_body, 0, $img_end + strlen('[/img]'));
$orig_body = substr($orig_body, $img_end + strlen('[/img]'));
if($orig_body === false) // in case the body ends on a closing image tag
$orig_body = '';
$img_start = strpos($orig_body, '[img');
$img_st_close = ($img_start !== false ? strpos(substr($orig_body, $img_start), ']') : false);
$img_end = ($img_start !== false ? strpos(substr($orig_body, $img_start), '[/img]') : false);
}
$new_body = $new_body . $orig_body;
return array('body' => $new_body, 'images' => $saved_image);
}}
if(! function_exists('bb_replace_images')) {
function bb_replace_images($body, $images) {
$newbody = $body;
$cnt = 0;
foreach($images as $image) {
// We're depending on the property of 'foreach' (specified on the PHP website) that
// it loops over the array starting from the first element and going sequentially
// to the last element
$newbody = str_replace('[$#saved_image' . $cnt . '#$]', '<img src="' . $image .'" alt="' . t('Image/photo') . '" />', $newbody);
$cnt++;
}
return $newbody;
}}
// BBcode 2 HTML was written by WAY2WEB.net
// extended to work with Mistpark/Friendica - Mike Macgirvin
@ -54,29 +115,21 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
$a = get_app();
// Hide all [noparse] contained bbtags spacefying them
// Hide all [noparse] contained bbtags by spacefying them
// POSSIBLE BUG --> Will the 'preg' functions crash if there's an embedded image?
$Text = preg_replace_callback("/\[noparse\](.*?)\[\/noparse\]/ism", 'bb_spacefy',$Text);
$Text = preg_replace_callback("/\[nobb\](.*?)\[\/nobb\]/ism", 'bb_spacefy',$Text);
$Text = preg_replace_callback("/\[pre\](.*?)\[\/pre\]/ism", 'bb_spacefy',$Text);
// Extract a single private image which uses data url's since preg has issues with
// large data sizes. Stash it away while we do bbcode conversion, and then put it back
// Extract the private images which use data url's since preg has issues with
// large data sizes. Stash them away while we do bbcode conversion, and then put them back
// in after we've done all the regex matching. We cannot use any preg functions to do this.
$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]'));
// logger('saved_image: ' . $saved_image,LOGGER_DEBUG);
$Text = $start_fragment . '[$#saved_image#$]' . $end_fragment;
}
$extracted = bb_extract_images($Text);
$Text = $extracted['body'];
$saved_image = $extracted['images'];
// If we find any event code, turn it into an event.
// After we're finished processing the bbcode we'll
@ -333,8 +386,9 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
// fix any escaped ampersands that may have been converted into links
$Text = preg_replace("/\<(.*?)(src|href)=(.*?)\&amp\;(.*?)\>/ism",'<$1$2=$3&$4>',$Text);
if(strlen($saved_image))
$Text = str_replace('[$#saved_image#$]','<img src="' . $saved_image .'" alt="' . t('Image/photo') . '" />',$Text);
if($saved_image)
$Text = bb_replace_images($Text, $saved_image);
call_hooks('bbcode',$Text);


+ 82
- 20
include/conversation.php View File

@ -1,30 +1,92 @@
<?php
// Note: the code in 'item_extract_images' and 'item_redir_and_replace_images'
// is identical to the code in mod/message.php for 'item_extract_images' and
// 'item_redir_and_replace_images'
if(! function_exists('item_extract_images')) {
function item_extract_images($body) {
$saved_image = array();
$orig_body = $body;
$new_body = '';
$cnt = 0;
$img_start = strpos($orig_body, '[img');
$img_st_close = ($img_start !== false ? strpos(substr($orig_body, $img_start), ']') : false);
$img_end = ($img_start !== false ? strpos(substr($orig_body, $img_start), '[/img]') : false);
while(($img_st_close !== false) && ($img_end !== false)) {
$img_st_close++; // make it point to AFTER the closing bracket
$img_end += $img_start;
if(! strcmp(substr($orig_body, $img_start + $img_st_close, 5), 'data:')) {
// This is an embedded image
$saved_image[$cnt] = substr($orig_body, $img_start + $img_st_close, $img_end - ($img_start + $img_st_close));
$new_body = $new_body . substr($orig_body, 0, $img_start) . '[!#saved_image' . $cnt . '#!]';
$cnt++;
}
else
$new_body = $new_body . substr($orig_body, 0, $img_end + strlen('[/img]'));
$orig_body = substr($orig_body, $img_end + strlen('[/img]'));
if($orig_body === false) // in case the body ends on a closing image tag
$orig_body = '';
$img_start = strpos($orig_body, '[img');
$img_st_close = ($img_start !== false ? strpos(substr($orig_body, $img_start), ']') : false);
$img_end = ($img_start !== false ? strpos(substr($orig_body, $img_start), '[/img]') : false);
}
$new_body = $new_body . $orig_body;
return array('body' => $new_body, 'images' => $saved_image);
}}
if(! function_exists('item_redir_and_replace_images')) {
function item_redir_and_replace_images($body, $images, $cid) {
$origbody = $body;
$newbody = '';
for($i = 0; $i < count($images); $i++) {
$search = '/\[url\=(.*?)\]\[!#saved_image' . $i . '#!\]\[\/url\]' . '/is';
$replace = '[url=' . z_path() . '/redir/' . $cid
. '?f=1&url=' . '$1' . '][!#saved_image' . $i . '#!][/url]' ;
$img_end = strpos($origbody, '[!#saved_image' . $i . '#!][/url]') + strlen('[!#saved_image' . $i . '#!][/url]');
$process_part = substr($origbody, 0, $img_end);
$origbody = substr($origbody, $img_end);
$process_part = preg_replace($search, $replace, $process_part);
$newbody = $newbody . $process_part;
}
$newbody = $newbody . $origbody;
$cnt = 0;
foreach($images as $image) {
// We're depending on the property of 'foreach' (specified on the PHP website) that
// it loops over the array starting from the first element and going sequentially
// to the last element
$newbody = str_replace('[!#saved_image' . $cnt . '#!]', '[img]' . $image . '[/img]', $newbody);
$cnt++;
}
return $newbody;
}}
/**
* Render actions localized
*/
function localize_item(&$item){
$Text = $item['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/' . $item['contact-id']
. '?f=1&url=' . '$1' . '][!#saved_image#!][/url]' ;
$Text = preg_replace($search,$replace,$Text);
if(strlen($saved_image))
$item['body'] = str_replace('[!#saved_image#!]', '[img]' . $saved_image . '[/img]',$Text);
}
$extracted = item_extract_images($item['body']);
if($extracted['images'])
$item['body'] = item_redir_and_replace_images($extracted['body'], $extracted['images'], $item['contact-id']);
$xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">";
if ($item['verb']=== ACTIVITY_LIKE || $item['verb']=== ACTIVITY_DISLIKE){


+ 146
- 18
include/items.php View File

@ -4,6 +4,8 @@ require_once('include/bbcode.php');
require_once('include/oembed.php');
require_once('include/salmon.php');
require_once('include/crypto.php');
require_once('include/Photo.php');
function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0) {
@ -278,7 +280,99 @@ function construct_activity_target($item) {
}
return '';
}
}
/* limit_body_size()
*
* The purpose of this function is to apply system message length limits to
* imported messages without including any embedded photos in the length
*/
if(! function_exists('limit_body_size')) {
function limit_body_size($body) {
logger('limit_body_size: start', LOGGER_DEBUG);
$maxlen = get_max_import_size();
// If the length of the body, including the embedded images, is smaller
// than the maximum, then don't waste time looking for the images
if($maxlen && (strlen($body) > $maxlen)) {
logger('limit_body_size: the total body length exceeds the limit', LOGGER_DEBUG);
$orig_body = $body;
$new_body = '';
$textlen = 0;
$max_found = false;
$img_start = strpos($orig_body, '[img');
$img_st_close = ($img_start !== false ? strpos(substr($orig_body, $img_start), ']') : false);
$img_end = ($img_start !== false ? strpos(substr($orig_body, $img_start), '[/img]') : false);
while(($img_st_close !== false) && ($img_end !== false)) {
$img_st_close++; // make it point to AFTER the closing bracket
$img_end += $img_start;
$img_end += strlen('[/img]');
if(! strcmp(substr($orig_body, $img_start + $img_st_close, 5), 'data:')) {
// This is an embedded image
if( ($textlen + $img_start) > $maxlen ) {
if($textlen < $maxlen) {
logger('limit_body_size: the limit happens before an embedded image', LOGGER_DEBUG);
$new_body = $new_body . substr($orig_body, 0, $maxlen - $textlen);
$textlen = $maxlen;
}
}
else {
$new_body = $new_body . substr($orig_body, 0, $img_start);
$textlen += $img_start;
}
$new_body = $new_body . substr($orig_body, $img_start, $img_end - $img_start);
}
else {
if( ($textlen + $img_end) > $maxlen ) {
if($textlen < $maxlen) {
logger('limit_body_size: the limit happens before the end of a non-embedded image', LOGGER_DEBUG);
$new_body = $new_body . substr($orig_body, 0, $maxlen - $textlen);
$textlen = $maxlen;
}
}
else {
$new_body = $new_body . substr($orig_body, 0, $img_end);
$textlen += $img_end;
}
}
$orig_body = substr($orig_body, $img_end);
if($orig_body === false) // in case the body ends on a closing image tag
$orig_body = '';
$img_start = strpos($orig_body, '[img');
$img_st_close = ($img_start !== false ? strpos(substr($orig_body, $img_start), ']') : false);
$img_end = ($img_start !== false ? strpos(substr($orig_body, $img_start), '[/img]') : false);
}
if( ($textlen + strlen($orig_body)) > $maxlen) {
if($textlen < $maxlen) {
logger('limit_body_size: the limit happens after the end of the last image', LOGGER_DEBUG);
$new_body = $new_body . substr($orig_body, 0, $maxlen - $textlen);
$textlen = $maxlen;
}
}
else {
logger('limit_body_size: the text size with embedded images extracted did not violate the limit', LOGGER_DEBUG);
$new_body = $new_body . $orig_body;
$textlen += strlen($orig_body);
}
return $new_body;
}
else
return $body;
}}
@ -414,9 +508,8 @@ function get_atom_elements($feed,$item) {
$res['body'] = notags(base64url_decode($res['body']));
}
$maxlen = get_max_import_size();
if($maxlen && (strlen($res['body']) > $maxlen))
$res['body'] = substr($res['body'],0, $maxlen);
$res['body'] = limit_body_size($res['body']);
// It isn't certain at this point whether our content is plaintext or html and we'd be foolish to trust
// the content type. Our own network only emits text normally, though it might have been converted to
@ -3088,20 +3181,33 @@ function atom_entry($item,$type,$author,$owner,$comment = false,$cid = 0) {
return $o;
}
function fix_private_photos($s,$uid, $item = null, $cid = 0) {
function fix_private_photos($s, $uid, $item = null, $cid = 0) {
$a = get_app();
logger('fix_private_photos', LOGGER_DEBUG);
$site = substr($a->get_baseurl(),strpos($a->get_baseurl(),'://'));
if(preg_match("/\[img(.*?)\](.*?)\[\/img\]/is",$s,$matches)) {
$image = $matches[2];
$orig_body = $s;
$new_body = '';
$img_start = strpos($orig_body, '[img');
$img_st_close = ($img_start !== false ? strpos(substr($orig_body, $img_start), ']') : false);
$img_len = ($img_start !== false ? strpos(substr($orig_body, $img_start + $img_st_close + 1), '[/img]') : false);
while( ($img_st_close !== false) && ($img_len !== false) ) {
$img_st_close++; // make it point to AFTER the closing bracket
$image = substr($orig_body, $img_start + $img_st_close, $img_len);
logger('fix_private_photos: found photo ' . $image, LOGGER_DEBUG);
if(stristr($image , $site . '/photo/')) {
// Only embed locally hosted photos
$replace = false;
$i = basename($image);
$i = str_replace(array('.jpg','.png'),array('',''),$i);
$x = strpos($i,'-');
if($x) {
$res = substr($i,$x+1);
$i = substr($i,0,$x);
@ -3119,14 +3225,6 @@ function fix_private_photos($s,$uid, $item = null, $cid = 0) {
// 3. Otherwise, if we have an item, see if the item permissions match the photo
// permissions, regardless of order but first check to see if they're an exact
// match to save some processing overhead.
// Currently we only embed one private photo per message so as not to hit import
// size limits at the receiving end.
// To embed multiples, we would need to parse out the embedded photos on message
// receipt and limit size based only on the text component. Would also need to
// ignore all photos during bbcode translation and item localisation, as these
// will hit internal regex backtrace limits.
if(has_permissions($r[0])) {
if($cid) {
@ -3141,15 +3239,45 @@ function fix_private_photos($s,$uid, $item = null, $cid = 0) {
}
}
if($replace) {
$data = $r[0]['data'];
$type = $r[0]['type'];
// If a custom width and height were specified, apply before embedding
if(preg_match("/\[img\=([0-9]*)x([0-9]*)\]/is", substr($orig_body, $img_start, $img_st_close), $match)) {
logger('fix_private_photos: scaling photo', LOGGER_DEBUG);
$width = intval($match[1]);
$height = intval($match[2]);
$ph = new Photo($data, $type);
if($ph->is_valid()) {
$ph->scaleImage(max($width, $height));
$data = $ph->imageString();
$type = $ph->getType();
}
}
logger('fix_private_photos: replacing photo', LOGGER_DEBUG);
$s = str_replace($image, 'data:' . $r[0]['type'] . ';base64,' . base64_encode($r[0]['data']), $s);
logger('fix_private_photos: replaced: ' . $s, LOGGER_DATA);
$image = 'data:' . $type . ';base64,' . base64_encode($data);
logger('fix_private_photos: replaced: ' . $image, LOGGER_DATA);
}
}
}
}
$new_body = $new_body . substr($orig_body, 0, $img_start + $img_st_close) . $image . '[/img]';
$orig_body = substr($orig_body, $img_start + $img_st_close + $img_len + strlen('[/img]'));
if($orig_body === false)
$orig_body = '';
$img_start = strpos($orig_body, '[img');
$img_st_close = ($img_start !== false ? strpos(substr($orig_body, $img_start), ']') : false);
$img_len = ($img_start !== false ? strpos(substr($orig_body, $img_start + $img_st_close + 1), '[/img]') : false);
}
return($s);
$new_body = $new_body . $orig_body;
return($new_body);
}


+ 0
- 0
include/security.php View File


+ 81
- 20
mod/message.php View File

@ -88,6 +88,84 @@ function message_post(&$a) {
}
// Note: the code in 'item_extract_images' and 'item_redir_and_replace_images'
// is identical to the code in include/conversation.php
if(! function_exists('item_extract_images')) {
function item_extract_images($body) {
$saved_image = array();
$orig_body = $body;
$new_body = '';
$cnt = 0;
$img_start = strpos($orig_body, '[img');
$img_st_close = ($img_start !== false ? strpos(substr($orig_body, $img_start), ']') : false);
$img_end = ($img_start !== false ? strpos(substr($orig_body, $img_start), '[/img]') : false);
while(($img_st_close !== false) && ($img_end !== false)) {
$img_st_close++; // make it point to AFTER the closing bracket
$img_end += $img_start;
if(! strcmp(substr($orig_body, $img_start + $img_st_close, 5), 'data:')) {
// This is an embedded image
$saved_image[$cnt] = substr($orig_body, $img_start + $img_st_close, $img_end - ($img_start + $img_st_close));
$new_body = $new_body . substr($orig_body, 0, $img_start) . '[!#saved_image' . $cnt . '#!]';
$cnt++;
}
else
$new_body = $new_body . substr($orig_body, 0, $img_end + strlen('[/img]'));
$orig_body = substr($orig_body, $img_end + strlen('[/img]'));
if($orig_body === false) // in case the body ends on a closing image tag
$orig_body = '';
$img_start = strpos($orig_body, '[img');
$img_st_close = ($img_start !== false ? strpos(substr($orig_body, $img_start), ']') : false);
$img_end = ($img_start !== false ? strpos(substr($orig_body, $img_start), '[/img]') : false);
}
$new_body = $new_body . $orig_body;
return array('body' => $new_body, 'images' => $saved_image);
}}
if(! function_exists('item_redir_and_replace_images')) {
function item_redir_and_replace_images($body, $images, $cid) {
$origbody = $body;
$newbody = '';
for($i = 0; $i < count($images); $i++) {
$search = '/\[url\=(.*?)\]\[!#saved_image' . $i . '#!\]\[\/url\]' . '/is';
$replace = '[url=' . z_path() . '/redir/' . $cid
. '?f=1&url=' . '$1' . '][!#saved_image' . $i . '#!][/url]' ;
$img_end = strpos($origbody, '[!#saved_image' . $i . '#!][/url]') + strlen('[!#saved_image' . $i . '#!][/url]');
$process_part = substr($origbody, 0, $img_end);
$origbody = substr($origbody, $img_end);
$process_part = preg_replace($search, $replace, $process_part);
$newbody = $newbody . $process_part;
}
$newbody = $newbody . $origbody;
$cnt = 0;
foreach($images as $image) {
// We're depending on the property of 'foreach' (specified on the PHP website) that
// it loops over the array starting from the first element and going sequentially
// to the last element
$newbody = str_replace('[!#saved_image' . $cnt . '#!]', '[img]' . $image . '[/img]', $newbody);
$cnt++;
}
return $newbody;
}}
function message_content(&$a) {
$o = '';
@ -345,26 +423,9 @@ function message_content(&$a) {
}
$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);
}
$extracted = item_extract_images($message['body']);
if($extracted['images'])
$message['body'] = item_redir_and_replace_images($extracted['body'], $extracted['images'], $message['contact-id']);
$mails[] = array(
'id' => $message['id'],


+ 2
- 1
mod/photos.php View File

@ -740,7 +740,8 @@ function photos_post(&$a) {
killme();
}
$ph->orient($src);
if($ph->getType() != 'image/png')
$ph->orient($src);
@unlink($src);
$max_length = get_config('system','max_image_length');


+ 0
- 0
util/run_xgettext.sh View File


+ 0
- 0
view/theme/diabook/ch_directory_item.tpl View File


+ 0
- 0
view/theme/diabook/communityhome.tpl View File


+ 0
- 0
view/theme/diabook/contact_template.tpl View File


+ 0
- 0
view/theme/diabook/diabook-aerith/icons/block.png View File

Before After
Width: 16  |  Height: 16  |  Size: 335 B Width: 16  |  Height: 16  |  Size: 335 B

+ 0
- 0
view/theme/diabook/diabook-blue/icons/block.png View File

Before After
Width: 16  |  Height: 16  |  Size: 335 B Width: 16  |  Height: 16  |  Size: 335 B

+ 0
- 0
view/theme/diabook/diabook-dark/icons/block.png View File

Before After
Width: 16  |  Height: 16  |  Size: 335 B Width: 16  |  Height: 16  |  Size: 335 B

+ 0
- 0
view/theme/diabook/diabook-green/icons/block.png View File

Before After
Width: 16  |  Height: 16  |  Size: 335 B Width: 16  |  Height: 16  |  Size: 335 B

+ 0
- 0
view/theme/diabook/diabook-green/icons/notifications3.png View File

Before After
Width: 22  |  Height: 22  |  Size: 714 B Width: 22  |  Height: 22  |  Size: 714 B

+ 0
- 0
view/theme/diabook/diabook-green/icons/notify3.png View File

Before After
Width: 22  |  Height: 22  |  Size: 534 B Width: 22  |  Height: 22  |  Size: 534 B

+ 0
- 0
view/theme/diabook/diabook-pink/icons/block.png View File

Before After
Width: 16  |  Height: 16  |  Size: 335 B Width: 16  |  Height: 16  |  Size: 335 B

+ 0
- 0
view/theme/diabook/diabook-pink/icons/notifications3.png View File

Before After
Width: 22  |  Height: 22  |  Size: 714 B Width: 22  |  Height: 22  |  Size: 714 B

+ 0
- 0
view/theme/diabook/diabook-pink/icons/notify3.png View File

Before After
Width: 22  |  Height: 22  |  Size: 534 B Width: 22  |  Height: 22  |  Size: 534 B

+ 0
- 0
view/theme/diabook/diabook-red/icons/block.png View File

Before After
Width: 16  |  Height: 16  |  Size: 335 B Width: 16  |  Height: 16  |  Size: 335 B

+ 0
- 0
view/theme/diabook/directory_item.tpl View File


+ 0
- 0
view/theme/diabook/group_side.tpl View File


+ 0
- 0
view/theme/diabook/icons/attach.png View File

Before After
Width: 28  |  Height: 28  |  Size: 1.0 KiB Width: 28  |  Height: 28  |  Size: 1.0 KiB

+ 0
- 0
view/theme/diabook/icons/audio.png View File

Before After
Width: 28  |  Height: 28  |  Size: 762 B Width: 28  |  Height: 28  |  Size: 762 B

+ 0
- 0
view/theme/diabook/icons/block.png View File

Before After
Width: 16  |  Height: 16  |  Size: 335 B Width: 16  |  Height: 16  |  Size: 335 B

+ 0
- 0
view/theme/diabook/icons/camera.png View File

Before After
Width: 28  |  Height: 28  |  Size: 685 B Width: 28  |  Height: 28  |  Size: 685 B

+ 0
- 0
view/theme/diabook/icons/close_box.png View File

Before After
Width: 12  |  Height: 12  |  Size: 206 B Width: 12  |  Height: 12  |  Size: 206 B

+ 0
- 0
view/theme/diabook/icons/contacts2.png View File

Before After
Width: 22  |  Height: 22  |  Size: 549 B Width: 22  |  Height: 22  |  Size: 549 B

+ 0
- 0
view/theme/diabook/icons/drop.png View File

Before After
Width: 16  |  Height: 16  |  Size: 292 B Width: 16  |  Height: 16  |  Size: 292 B

+ 0
- 0
view/theme/diabook/icons/expand.png View File

Before After
Width: 22  |  Height: 22  |  Size: 263 B Width: 22  |  Height: 22  |  Size: 263 B

+ 0
- 0
view/theme/diabook/icons/file_as.png View File

Before After
Width: 16  |  Height: 16  |  Size: 352 B Width: 16  |  Height: 16  |  Size: 352 B

+ 0
- 0
view/theme/diabook/icons/link.png View File

Before After
Width: 16  |  Height: 16  |  Size: 365 B Width: 16  |  Height: 16  |  Size: 365 B

+ 0
- 0
view/theme/diabook/icons/lock.png View File

Before After
Width: 16  |  Height: 16  |  Size: 366 B Width: 16  |  Height: 16  |  Size: 366 B

+ 0
- 0
view/theme/diabook/icons/lupe.png View File

Before After
Width: 20  |  Height: 20  |  Size: 697 B Width: 20  |  Height: 20  |  Size: 697 B

+ 0
- 0
view/theme/diabook/icons/next.png View File

Before After
Width: 20  |  Height: 20  |  Size: 300 B Width: 20  |  Height: 20  |  Size: 300 B

+ 0
- 0
view/theme/diabook/icons/notifications.png View File

Before After
Width: 22  |  Height: 22  |  Size: 926 B Width: 22  |  Height: 22  |  Size: 926 B

+ 0
- 0
view/theme/diabook/icons/notifications3.png View File

Before After
Width: 22  |  Height: 22  |  Size: 714 B Width: 22  |  Height: 22  |  Size: 714 B

+ 0
- 0
view/theme/diabook/icons/notify.png View File

Before After
Width: 22  |  Height: 22  |  Size: 1001 B Width: 22  |  Height: 22  |  Size: 1001 B

+ 0
- 0
view/theme/diabook/icons/notify3.png View File

Before After
Width: 22  |  Height: 22  |  Size: 534 B Width: 22  |  Height: 22  |  Size: 534 B

+ 0
- 0
view/theme/diabook/icons/pencil.png View File

Before After
Width: 16  |  Height: 16  |  Size: 286 B Width: 16  |  Height: 16  |  Size: 286 B

+ 0
- 0
view/theme/diabook/icons/prev.png View File

Before After
Width: 20  |  Height: 20  |  Size: 336 B Width: 20  |  Height: 20  |  Size: 336 B

+ 0
- 0
view/theme/diabook/icons/recycle.png View File

Before After
Width: 16  |  Height: 16  |  Size: 296 B Width: 16  |  Height: 16  |  Size: 296 B

+ 0
- 0
view/theme/diabook/icons/remote.png View File

Before After
Width: 15  |  Height: 16  |  Size: 427 B Width: 15  |  Height: 16  |  Size: 427 B

+ 0
- 0
view/theme/diabook/icons/scroll_top.png View File

Before After
Width: 26  |  Height: 26  |  Size: 296 B Width: 26  |  Height: 26  |  Size: 296 B

+ 0
- 0
view/theme/diabook/icons/star.png View File

Before After
Width: 16  |  Height: 16  |  Size: 388 B Width: 16  |  Height: 16  |  Size: 388 B

+ 0
- 0
view/theme/diabook/icons/starred.png View File

Before After
Width: 16  |  Height: 16  |  Size: 501 B Width: 16  |  Height: 16  |  Size: 501 B

+ 0
- 0
view/theme/diabook/icons/tagged.png View File

Before After
Width: 16  |  Height: 16  |  Size: 353 B Width: 16  |  Height: 16  |  Size: 353 B

+ 0
- 0
view/theme/diabook/icons/unlock.png View File

Before After
Width: 16  |  Height: 16  |  Size: 362 B Width: 16  |  Height: 16  |  Size: 362 B

+ 0
- 0
view/theme/diabook/icons/unstarred.png View File

Before After
Width: 17  |  Height: 17  |  Size: 468 B Width: 17  |  Height: 17  |  Size: 468 B

+ 0
- 0
view/theme/diabook/icons/video.png View File

Before After
Width: 28  |  Height: 28  |  Size: 472 B Width: 28  |  Height: 28  |  Size: 472 B

+ 0
- 0
view/theme/diabook/icons/weblink.png View File

Before After
Width: 21  |  Height: 23  |  Size: 505 B Width: 21  |  Height: 23  |  Size: 505 B

+ 0
- 0
view/theme/diabook/jot.tpl View File


+ 0
- 0
view/theme/diabook/mail_conv.tpl View File


+ 0
- 0
view/theme/diabook/search_item.tpl View File


+ 0
- 0
view/theme/diabook/theme.php View File


Loading…
Cancel
Save