Merge branch 'release-0.8' of github.com:roundcube/roundcubemail into release-0.8
| | |
| | | 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 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 |
| | |
| | | |
| | | 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. |
| | |
| | | $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'); |
| | | |
| | |
| | | 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(); |
| | |
| | | |
| | | 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; |
| | | } |
| | |
| | | this.add_contact = function(value) |
| | | { |
| | | if (value) |
| | | this.http_post('addcontact', '_address='+value); |
| | | this.http_post('addcontact', {_address: value}); |
| | | |
| | | return true; |
| | | }; |
| | |
| | | '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; |
| | |
| | | |
| | | |
| | | /* 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); |
| | |
| | | } |
| | | |
| | | /* Check CSS style */ |
| | | private function wash_style($style) { |
| | | private function wash_style($style) |
| | | { |
| | | $s = ''; |
| | | |
| | | foreach (explode(';', $style) as $declaration) { |
| | |
| | | } |
| | | |
| | | /* Take a node and return allowed attributes and check values */ |
| | | private function wash_attribs($node) { |
| | | private function wash_attribs($node) |
| | | { |
| | | $t = ''; |
| | | $washed; |
| | | |
| | |
| | | /* 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 ''; |
| | | |
| | |
| | | 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 -->'; |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | ?> |
| | |
| | | $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; |
| | |
| | | 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', |
| | | ), |