Aleksander Machniak
2012-06-08 8749e94b4bed36500e4f45c65cc16cfd5633ef34
program/steps/mail/func.inc
@@ -947,7 +947,7 @@
  // single header value is requested
  if (!empty($attrib['valueof']))
    return Q($plugin['output'][$attrib['valueof']]['value'], ($hkey == 'subject' ? 'strict' : 'show'));
    return Q($plugin['output'][$attrib['valueof']]['value'], ($attrib['valueof'] == 'subject' ? 'strict' : 'show'));
  // compose html table
  $table = new html_table(array('cols' => 2));
@@ -1193,14 +1193,15 @@
  // find STYLE tags
  while (($pos = stripos($body, '<style', $last_style_pos)) && ($pos2 = stripos($body, '</style>', $pos)))
  {
    $pos = strpos($body, '>', $pos)+1;
    $pos = strpos($body, '>', $pos) + 1;
    $len = $pos2 - $pos;
    // replace all css definitions with #container [def]
    $styles = rcmail_mod_css_styles(
      substr($body, $pos, $pos2-$pos), $cont_id, $allow_remote);
    $styles = substr($body, $pos, $len);
    $styles = rcmail_mod_css_styles($styles, $cont_id, $allow_remote);
    $body = substr_replace($body, $styles, $pos, $pos2-$pos);
    $last_style_pos = $pos2;
    $body = substr_replace($body, $styles, $pos, $len);
    $last_style_pos = $pos2 + strlen($styles) - $len;
  }
  // modify HTML links to open a new window if clicked
@@ -1476,13 +1477,13 @@
function rcmail_message_part_controls($attrib)
{
  global $MESSAGE;
  global $MESSAGE, $RCMAIL;
  $part = asciiwords(get_input_value('_part', RCUBE_INPUT_GPC));
  if (!is_object($MESSAGE) || !is_array($MESSAGE->parts) || !($_GET['_uid'] && $_GET['_part']) || !$MESSAGE->mime_parts[$part])
    return '';
  $part = $MESSAGE->mime_parts[$part];
  $part  = $MESSAGE->mime_parts[$part];
  $table = new html_table(array('cols' => 3));
  $filename = $part->filename;
@@ -1496,10 +1497,8 @@
    $table->add('download-link', html::a(array('href' => './?'.str_replace('_frame=', '_download=', $_SERVER['QUERY_STRING'])), Q(rcube_label('download'))));
  }
  if (!empty($part->size)) {
    $table->add('title', Q(rcube_label('filesize')));
    $table->add('header', Q(show_bytes($part->size)));
  }
  $table->add('title', Q(rcube_label('filesize')));
  $table->add('header', Q($RCMAIL->message_part_size($part)));
  return $table->show($attrib);
}