Thomas Bruederli
2012-05-12 5c6d1ac5a25550515a20b74c1986045127a87265
Merge branch 'release-0.8' of github.com:roundcube/roundcubemail into release-0.8
9 files modified
82 ■■■■ changed files
.htaccess 2 ●●● patch | view | raw | blame | history
CHANGELOG 3 ●●●●● patch | view | raw | blame | history
README.md 2 ●●● patch | view | raw | blame | history
program/include/rcmail.php 2 ●●● patch | view | raw | blame | history
program/include/rcube_plugin.php 38 ●●●● patch | view | raw | blame | history
program/js/app.js 4 ●●●● patch | view | raw | blame | history
program/lib/washtml.php 22 ●●●● patch | view | raw | blame | history
program/steps/addressbook/func.inc 7 ●●●● patch | view | raw | blame | history
program/steps/mail/func.inc 2 ●●● patch | view | raw | blame | history
.htaccess
@@ -30,7 +30,7 @@
RewriteEngine On
RewriteRule ^favicon\.ico$ skins/default/images/favicon.ico
# security rules
RewriteRule .svn/ - [F]
RewriteRule .git/ - [F]
RewriteRule ^README|INSTALL|LICENSE|SQL|bin|CHANGELOG$ - [F]
</IfModule>
CHANGELOG
@@ -1,6 +1,9 @@
CHANGELOG Roundcube Webmail
===========================
- Fix handling of "usemap" attribute (#1488472)
- Fix handling of some HTML tags e.g. IMG (#1488471)
- Use similar language as a fallback for plugin localization (#1488401)
- Fix issue where signature wasn't re-added on draft compose (#1488322)
- Update to TinyMCE 3.5 (#1488459)
- Fixed multi-threaded autocompletion when number of threads > number of sources
README.md
@@ -5,7 +5,7 @@
ATTENTION
---------
This is just a snapshot of the current SVN repository and is **NOT A STABLE
This is just a snapshot from the GIT repository and is **NOT A STABLE
version of Roundcube**. It's not recommended to replace an existing installation
of Roundcube with this version. Also using a separate database for this
installation is highly recommended.
program/include/rcmail.php
@@ -1167,7 +1167,7 @@
        $this->texts = array_merge($this->texts, $messages);
      // include user language files
      if ($lang != 'en' && is_dir(INSTALL_PATH . 'program/localization/' . $lang)) {
      if ($lang != 'en' && $lang != 'en_US' && is_dir(INSTALL_PATH . 'program/localization/' . $lang)) {
        include_once(INSTALL_PATH . 'program/localization/' . $lang . '/labels.inc');
        include_once(INSTALL_PATH . 'program/localization/' . $lang . '/messages.inc');
program/include/rcube_plugin.php
@@ -152,20 +152,48 @@
  public function add_texts($dir, $add2client = false)
  {
    $domain = $this->ID;
    $lang = $_SESSION['language'];
    $lang   = $_SESSION['language'];
    $langs  = array_unique(array('en_US', $lang));
    $locdir = slashify(realpath(slashify($this->home) . $dir));
    $texts = array();
    $texts  = array();
    // Language aliases used to find localization in similar lang, see below
    $aliases = array(
        'de_CH' => 'de_DE',
        'es_AR' => 'es_ES',
        'fa_AF' => 'fa_IR',
        'nl_BE' => 'nl_NL',
        'pt_BR' => 'pt_PT',
        'zh_CN' => 'zh_TW',
    );
    // use buffering to handle empty lines/spaces after closing PHP tag
    ob_start();
    foreach (array('en_US', $lang) as $lng) {
    foreach ($langs as $lng) {
      $fpath = $locdir . $lng . '.inc';
      if (is_file($fpath) && is_readable($fpath)) {
        include($fpath);
        include $fpath;
        $texts = (array)$labels + (array)$messages + (array)$texts;
      }
      else if ($lng != 'en_US') {
        // Find localization in similar language (#1488401)
        $alias = null;
        if (!empty($aliases[$lng])) {
          $alias = $aliases[$lng];
        }
        else if ($key = array_search($lng, $aliases)) {
          $alias = $key;
        }
        if (!empty($alias)) {
          $fpath = $locdir . $alias . '.inc';
          if (is_file($fpath) && is_readable($fpath)) {
            include $fpath;
            $texts = (array)$labels + (array)$messages + (array)$texts;
          }
        }
      }
    }
    ob_end_clean();
program/js/app.js
@@ -766,7 +766,7 @@
      case 'always-load':
        if (this.env.uid && this.env.sender) {
          this.add_contact(urlencode(this.env.sender));
          this.add_contact(this.env.sender);
          setTimeout(function(){ ref.command('load-images'); }, 300);
          break;
        }
@@ -3527,7 +3527,7 @@
  this.add_contact = function(value)
  {
    if (value)
      this.http_post('addcontact', '_address='+value);
      this.http_post('addcontact', {_address: value});
    return true;
  };
program/lib/washtml.php
@@ -101,14 +101,14 @@
    'cellpadding', 'valign', 'bgcolor', 'color', 'border', 'bordercolorlight',
    'bordercolordark', 'face', 'marginwidth', 'marginheight', 'axis', 'border',
    'abbr', 'char', 'charoff', 'clear', 'compact', 'coords', 'vspace', 'hspace',
    'cellborder', 'size', 'lang', 'dir',
    'cellborder', 'size', 'lang', 'dir', 'usemap',
    // attributes of form elements
    'type', 'rows', 'cols', 'disabled', 'readonly', 'checked', 'multiple', 'value'
  );
  /* Block elements which could be empty but cannot be returned in short form (<tag />) */
  static $block_elements = array('div', 'p', 'pre', 'blockquote', 'a', 'font', 'center',
    'table', 'ul', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ol', 'dl', 'strong', 'i', 'b', 'u');
    'table', 'ul', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ol', 'dl', 'strong', 'i', 'b', 'u', 'span');
  /* State for linked objects in HTML */
  public $extlinks = false;
@@ -133,7 +133,8 @@
  /* Constructor */
  public function __construct($p = array()) {
  public function __construct($p = array())
  {
    $this->_html_elements = array_flip((array)$p['html_elements']) + array_flip(self::$html_elements) ;
    $this->_html_attribs = array_flip((array)$p['html_attribs']) + array_flip(self::$html_attribs);
    $this->_ignore_elements = array_flip((array)$p['ignore_elements']) + array_flip(self::$ignore_elements);
@@ -149,7 +150,8 @@
  }
  /* Check CSS style */
  private function wash_style($style) {
  private function wash_style($style)
  {
    $s = '';
    foreach (explode(';', $style) as $declaration) {
@@ -191,7 +193,8 @@
  }
  /* Take a node and return allowed attributes and check values */
  private function wash_attribs($node) {
  private function wash_attribs($node)
  {
    $t = '';
    $washed;
@@ -231,7 +234,8 @@
  /* The main loop that recurse on a node tree.
   * It output only allowed tags with allowed attributes
   * and allowed inline styles */
  private function dumpHtml($node) {
  private function dumpHtml($node)
  {
    if(!$node->hasChildNodes())
      return '';
@@ -248,9 +252,7 @@
        else if (isset($this->_html_elements[$tagName])) {
          $content = $this->dumpHtml($node);
          $dump .= '<' . $tagName . $this->wash_attribs($node) .
            // create closing tag for block elements, but also for elements
            // with content or with some attributes (eg. style, class) (#1486812)
            ($content != '' || $node->hasAttributes() || isset($this->_block_elements[$tagName]) ? ">$content</$tagName>" : ' />');
            ($content != '' || isset($this->_block_elements[$tagName]) ? ">$content</$tagName>" : ' />');
        }
        else if (isset($this->_ignore_elements[$tagName])) {
          $dump .= '<!-- ' . htmlspecialchars($tagName, ENT_QUOTES) . ' not allowed -->';
@@ -310,5 +312,3 @@
  }
}
?>
program/steps/addressbook/func.inc
@@ -593,7 +593,12 @@
                        $composite = array(); $j = 0;
                        $template = $RCMAIL->config->get($col . '_template', '{'.join('} {', array_keys($colprop['childs'])).'}');
                        foreach ($colprop['childs'] as $childcol => $cp) {
                            $childvalue = $val[$childcol] ? $val[$childcol] : $val[$j];
                            if (!empty($val) && is_array($val)) {
                                $childvalue = $val[$childcol] ? $val[$childcol] : $val[$j];
                            }
                            else {
                                $childvalue = '';
                            }
                            if ($edit_mode) {
                                if ($colprop['subtypes'] || $colprop['limit'] != 1) $cp['array'] = true;
program/steps/mail/func.inc
@@ -1330,7 +1330,7 @@
      if ($addicon && $_SESSION['writeable_abook']) {
        $address = html::span(null, $address . html::a(array(
            'href' => "#add",
            'onclick' => sprintf("return %s.command('add-contact','%s',this)", JS_OBJECT_NAME, urlencode($string)),
            'onclick' => sprintf("return %s.command('add-contact','%s',this)", JS_OBJECT_NAME, $string),
            'title' => rcube_label('addtoaddressbook'),
            'class' => 'rcmaddcontact',
          ),