Merge branch 'release-0.8' of github.com:roundcube/roundcubemail into release-0.8

pull/17/head
Thomas Bruederli 12 years ago
commit 5c6d1ac5a2

@ -30,7 +30,7 @@ php_value mbstring.func_overload 0
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>

@ -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

@ -5,7 +5,7 @@ Roundcube Webmail
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.

@ -1167,7 +1167,7 @@ class rcmail
$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');

@ -152,20 +152,48 @@ abstract class rcube_plugin
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();

@ -766,7 +766,7 @@ function rcube_webmail()
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 @@ function rcube_webmail()
this.add_contact = function(value)
{
if (value)
this.http_post('addcontact', '_address='+value);
this.http_post('addcontact', {_address: value});
return true;
};

@ -101,14 +101,14 @@ class washtml
'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 @@ class washtml
/* 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 @@ class washtml
}
/* Check CSS style */
private function wash_style($style) {
private function wash_style($style)
{
$s = '';
foreach (explode(';', $style) as $declaration) {
@ -191,7 +193,8 @@ class washtml
}
/* 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 @@ class washtml
/* 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 @@ class washtml
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 @@ class washtml
}
}
?>

@ -593,7 +593,12 @@ function rcmail_contact_form($form, $record, $attrib = null)
$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;

@ -1330,7 +1330,7 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null,
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',
),

Loading…
Cancel
Save