alecpl
2010-08-12 1a2f8375ded7563964ea24c44c7874a92e6f7b77
program/include/main.inc
@@ -732,8 +732,9 @@
  $table = new html_table(/*array('cols' => count($a_show_cols))*/);
    
  // add table header
  foreach ($a_show_cols as $col)
    $table->add_header($col, Q(rcube_label($col)));
  if (!$attrib['noheader'])
    foreach ($a_show_cols as $col)
      $table->add_header($col, Q(rcube_label($col)));
  
  $c = 0;
  if (!is_array($table_data)) 
@@ -829,6 +830,9 @@
  if (preg_match('/expression|behavior|url\(|import/', $stripped))
    return '/* evil! */';
  // remove css comments (sometimes used for some ugly hacks)
  $source = preg_replace('!/\*(.+)\*/!Ums', '', $source);
  // cut out all contents between { and }
  while (($pos = strpos($source, '{', $last_pos)) && ($pos2 = strpos($source, '}', $pos)))
  {
@@ -836,13 +840,13 @@
    $source = substr($source, 0, $pos+1) . $replacements->get_replacement($key) . substr($source, $pos2, strlen($source)-$pos2);
    $last_pos = $pos+2;
  }
  // remove html comments and add #container to each tag selector.
  // also replace body definition because we also stripped off the <body> tag
  $styles = preg_replace(
    array(
      '/(^\s*<!--)|(-->\s*$)/',
      '/(^\s*|,\s*|\}\s*)([a-z0-9\._#][a-z0-9\.\-_]*)/im',
      '/(^\s*|,\s*|\}\s*)([a-z0-9\._#\*][a-z0-9\.\-_]*)/im',
      "/$container_id\s+body/i",
    ),
    array(
@@ -1521,8 +1525,10 @@
function rcube_https_check($port=null, $use_https=true)
{
  global $RCMAIL;
  if (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off')
    return true;
  if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https')
    return true;
  if ($port && $_SERVER['SERVER_PORT'] == $port)
    return true;
@@ -1582,7 +1588,7 @@
  // from PEAR::Validate
  $regexp = '&^(?:
   ("\s*(?:[^"\f\n\r\t\v\b\s]+\s*)+")|              #1 quoted name
   ([-\w!\#\$%\&\'*+~/^`|{}]+(?:\.[-\w!\#\$%\&\'*+~/^`|{}]+)*))    #2 OR dot-atom
   ([-\w!\#\$%\&\'*+~/^`|{}=]+(?:\.[-\w!\#\$%\&\'*+~/^`|{}=]+)*))    #2 OR dot-atom (RFC5322)
   $&xi';
  if (!preg_match($regexp, $local_part))
@@ -1726,4 +1732,3 @@
    }
}
?>