summaryrefslogtreecommitdiff
path: root/program/lib
diff options
context:
space:
mode:
Diffstat (limited to 'program/lib')
-rw-r--r--program/lib/Roundcube/README.md102
-rw-r--r--program/lib/Roundcube/rcube.php2
-rw-r--r--program/lib/Roundcube/rcube_addressbook.php4
-rw-r--r--program/lib/Roundcube/rcube_db.php100
-rw-r--r--program/lib/Roundcube/rcube_imap.php23
-rw-r--r--program/lib/Roundcube/rcube_imap_generic.php26
-rw-r--r--program/lib/Roundcube/rcube_ldap.php1
-rw-r--r--program/lib/Roundcube/rcube_message.php9
-rw-r--r--program/lib/Roundcube/rcube_message_header.php16
-rw-r--r--program/lib/Roundcube/rcube_mime.php3
-rw-r--r--program/lib/Roundcube/rcube_plugin.php14
-rw-r--r--program/lib/Roundcube/rcube_plugin_api.php3
-rw-r--r--program/lib/Roundcube/rcube_storage.php3
-rw-r--r--program/lib/Roundcube/rcube_user.php2
-rw-r--r--program/lib/washtml.php2
15 files changed, 208 insertions, 102 deletions
diff --git a/program/lib/Roundcube/README.md b/program/lib/Roundcube/README.md
new file mode 100644
index 000000000..88f2d076e
--- /dev/null
+++ b/program/lib/Roundcube/README.md
@@ -0,0 +1,102 @@
+Roundcube Framework
+===================
+
+INTRODUCTION
+------------
+The Roundcube Framework is the basic library used for the Roundcube Webmail
+application. It is an extract of classes providing the core functionality for
+an email system. They can be used individually or as package for the following
+tasks:
+
+- IMAP mailbox access with optional caching
+- MIME message handling
+- Email message creation and sending through SMTP
+- General caching utilities using the local database
+- Database abstraction using PDO
+- VCard parsing and writing
+
+
+INSTALLATION
+------------
+Copy all files of this directory to your project or install it in the default
+include_path directory of your webserver. Some classes of the framework require
+one or multiple of the following [PEAR][pear] libraries:
+
+- Mail_Mime 1.8.1 or newer
+- Mail_mimeDecode 1.5.5 or newer
+- Net_SMTP (latest from https://github.com/pear/Net_SMTP/)
+- Net_IDNA2 0.1.1 or newer
+- Auth_SASL 1.0.6 or newer
+
+
+USAGE
+-----
+The Roundcube Framework provides a bootstrapping file which registers an
+autoloader and sets up the environment necessary for the Roundcube classes.
+In order to make use of the framework, simply include the bootstrap.php file
+from this directory in your application and start using the classes by simply
+instantiating them.
+
+If you wanna use more complex functionality like IMAP access with database
+caching or plugins, the rcube singleton helps you loading the necessary files:
+
+```php
+<?php
+
+define('RCUBE_CONFIG_DIR', '<path-to-config-directory>');
+define('RCUBE_PLUGINS_DIR', '<path-to-roundcube-plugins-directory');
+
+require_once '<path-to-roundcube-framework/bootstrap.php';
+
+$rcube = rcube::get_instance(rcube::INIT_WITH_DB | rcube::INIT_WITH_PLUGINS);
+$imap = $rcube->get_storage();
+
+// do cool stuff here...
+
+?>
+```
+
+LICENSE
+-------
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License (**with exceptions
+for plugins**) as published by the Free Software Foundation, either
+version 3 of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see [www.gnu.org/licenses/][gpl].
+
+This file forms part of the Roundcube Webmail Framework for which the
+following exception is added: Plugins which merely make function calls to the
+Roundcube Webmail Framework, and for that purpose include it by reference
+shall not be considered modifications of the software.
+
+If you wish to use this file in another project or create a modified
+version that will not be part of the Roundcube Webmail Framework, you
+may remove the exception above and use this source code under the
+original version of the license.
+
+For more details about licensing and the exceptions for skins and plugins
+see [roundcube.net/license][license]
+
+
+CONTACT
+-------
+For any bug reports or feature requests please refer to the tracking system
+at [trac.roundcube.net][tracreport] or subscribe to our mailing list.
+See [roundcube.net/support][support] for details.
+
+You're always welcome to send a message to the project admins:
+hello(at)roundcube(dot)net
+
+
+[pear]: http://pear.php.net
+[gpl]: http://www.gnu.org/licenses/
+[license]: http://roundcube.net/license
+[support]: http://roundcube.net/support
+[tracreport]: http://trac.roundcube.net/wiki/Howto_ReportIssues \ No newline at end of file
diff --git a/program/lib/Roundcube/rcube.php b/program/lib/Roundcube/rcube.php
index c3aa8ffa5..cc4905a14 100644
--- a/program/lib/Roundcube/rcube.php
+++ b/program/lib/Roundcube/rcube.php
@@ -36,7 +36,7 @@ class rcube
/**
* Singleton instace of rcube
*
- * @var rcmail
+ * @var rcube
*/
static protected $instance;
diff --git a/program/lib/Roundcube/rcube_addressbook.php b/program/lib/Roundcube/rcube_addressbook.php
index d14fc587a..ea8df700c 100644
--- a/program/lib/Roundcube/rcube_addressbook.php
+++ b/program/lib/Roundcube/rcube_addressbook.php
@@ -209,13 +209,13 @@ abstract class rcube_addressbook
*/
public function validate(&$save_data, $autofix = false)
{
- $rcmail = rcube::get_instance();
+ $rcube = rcube::get_instance();
// check validity of email addresses
foreach ($this->get_col_values('email', $save_data, true) as $email) {
if (strlen($email)) {
if (!rcube_utils::check_email(rcube_utils::idn_to_ascii($email))) {
- $error = $rcmail->gettext(array('name' => 'emailformaterror', 'vars' => array('email' => $email)));
+ $error = $rcube->gettext(array('name' => 'emailformaterror', 'vars' => array('email' => $email)));
$this->set_error(self::ERROR_VALIDATE, $error);
return false;
}
diff --git a/program/lib/Roundcube/rcube_db.php b/program/lib/Roundcube/rcube_db.php
index 5d8c4a534..2c471e74d 100644
--- a/program/lib/Roundcube/rcube_db.php
+++ b/program/lib/Roundcube/rcube_db.php
@@ -37,12 +37,11 @@ class rcube_db
protected $db_mode; // Connection mode
protected $dbh; // Connection handle
- protected $db_error = false;
- protected $db_error_msg = '';
- protected $conn_failure = false;
- protected $a_query_results = array('dummy');
- protected $last_res_id = 0;
- protected $db_index = 0;
+ protected $db_error = false;
+ protected $db_error_msg = '';
+ protected $conn_failure = false;
+ protected $db_index = 0;
+ protected $last_result;
protected $tables;
protected $variables;
@@ -267,14 +266,14 @@ class rcube_db
/**
* Getter for error state
*
- * @param int $res_id Optional query result identifier
+ * @param mixed $result Optional query result
*
* @return string Error message
*/
- public function is_error($res_id = null)
+ public function is_error($result = null)
{
- if ($res_id !== null) {
- return $this->_get_result($res_id) === false ? $this->db_error_msg : null;
+ if ($result !== null) {
+ return $result === false ? $this->db_error_msg : null;
}
return $this->db_error ? $this->db_error_msg : null;
@@ -343,7 +342,7 @@ class rcube_db
* @param int Number of rows for LIMIT statement
* @param mixed Values to be inserted in query
*
- * @return int Query handle identifier
+ * @return PDOStatement|bool Query handle or False on error
*/
public function limitquery()
{
@@ -363,7 +362,7 @@ class rcube_db
* @param int $numrows Number of rows for LIMIT statement
* @param array $params Values to be inserted in query
*
- * @return int Query handle identifier
+ * @return PDOStatement|bool Query handle or False on error
*/
protected function _query($query, $offset, $numrows, $params)
{
@@ -374,7 +373,7 @@ class rcube_db
// check connection before proceeding
if (!$this->is_connected()) {
- return null;
+ return $this->last_result = false;
}
if ($numrows || $offset) {
@@ -417,20 +416,21 @@ class rcube_db
'message' => $this->db_error_msg), true, false);
}
- // add result, even if it's an error
- return $this->_add_result($query);
+ $this->last_result = $query;
+
+ return $query;
}
/**
* Get number of affected rows for the last query
*
- * @param number $res_id Optional query handle identifier
+ * @param mixed $result Optional query handle
*
* @return int Number of rows or false on failure
*/
- public function affected_rows($res_id = null)
+ public function affected_rows($result = null)
{
- if ($result = $this->_get_result($res_id)) {
+ if ($result || ($result === null && ($result = $this->last_result))) {
return $result->rowCount();
}
@@ -464,13 +464,12 @@ class rcube_db
* Get an associative array for one row
* If no query handle is specified, the last query will be taken as reference
*
- * @param int $res_id Optional query handle identifier
+ * @param mixed $result Optional query handle
*
* @return mixed Array with col values or false on failure
*/
- public function fetch_assoc($res_id = null)
+ public function fetch_assoc($result = null)
{
- $result = $this->_get_result($res_id);
return $this->_fetch_row($result, PDO::FETCH_ASSOC);
}
@@ -478,31 +477,30 @@ class rcube_db
* Get an index array for one row
* If no query handle is specified, the last query will be taken as reference
*
- * @param int $res_id Optional query handle identifier
+ * @param mixed $result Optional query handle
*
* @return mixed Array with col values or false on failure
*/
- public function fetch_array($res_id = null)
+ public function fetch_array($result = null)
{
- $result = $this->_get_result($res_id);
return $this->_fetch_row($result, PDO::FETCH_NUM);
}
/**
* Get col values for a result row
*
- * @param PDOStatement $result Result handle
- * @param int $mode Fetch mode identifier
+ * @param mixed $result Optional query handle
+ * @param int $mode Fetch mode identifier
*
* @return mixed Array with col values or false on failure
*/
protected function _fetch_row($result, $mode)
{
- if (!is_object($result) || !$this->is_connected()) {
- return false;
+ if ($result || ($result === null && ($result = $this->last_result))) {
+ return $result->fetch($mode);
}
- return $result->fetch($mode);
+ return false;
}
/**
@@ -538,8 +536,8 @@ class rcube_db
if ($this->tables === null) {
$q = $this->query('SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES ORDER BY TABLE_NAME');
- if ($res = $this->_get_result($q)) {
- $this->tables = $res->fetchAll(PDO::FETCH_COLUMN, 0);
+ if ($q) {
+ $this->tables = $q->fetchAll(PDO::FETCH_COLUMN, 0);
}
else {
$this->tables = array();
@@ -561,8 +559,8 @@ class rcube_db
$q = $this->query('SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ?',
array($table));
- if ($res = $this->_get_result($q)) {
- return $res->fetchAll(PDO::FETCH_COLUMN, 0);
+ if ($q) {
+ return $q->fetchAll(PDO::FETCH_COLUMN, 0);
}
return array();
@@ -777,42 +775,6 @@ class rcube_db
}
/**
- * Adds a query result and returns a handle ID
- *
- * @param object $res Query handle
- *
- * @return int Handle ID
- */
- protected function _add_result($res)
- {
- $this->last_res_id = sizeof($this->a_query_results);
- $this->a_query_results[$this->last_res_id] = $res;
-
- return $this->last_res_id;
- }
-
- /**
- * Resolves a given handle ID and returns the according query handle
- * If no ID is specified, the last resource handle will be returned
- *
- * @param int $res_id Handle ID
- *
- * @return mixed Resource handle or false on failure
- */
- protected function _get_result($res_id = null)
- {
- if ($res_id == null) {
- $res_id = $this->last_res_id;
- }
-
- if (!empty($this->a_query_results[$res_id])) {
- return $this->a_query_results[$res_id];
- }
-
- return false;
- }
-
- /**
* Return correct name for a specific database table
*
* @param string $table Table name
diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php
index 8ca24dec7..ea3743d02 100644
--- a/program/lib/Roundcube/rcube_imap.php
+++ b/program/lib/Roundcube/rcube_imap.php
@@ -151,7 +151,7 @@ class rcube_imap extends rcube_storage
$attempt = 0;
do {
- $data = rcube::get_instance()->plugins->exec_hook('imap_connect',
+ $data = rcube::get_instance()->plugins->exec_hook('storage_connect',
array_merge($this->options, array('host' => $host, 'user' => $user,
'attempt' => ++$attempt)));
@@ -571,7 +571,7 @@ class rcube_imap extends rcube_storage
* Get message count for a specific folder
*
* @param string $folder Folder name
- * @param string $mode Mode for count [ALL|THREADS|UNSEEN|RECENT]
+ * @param string $mode Mode for count [ALL|THREADS|UNSEEN|RECENT|EXISTS]
* @param boolean $force Force reading from server and update cache
* @param boolean $status Enables storing folder status info (max UID/count),
* required for folder_status()
@@ -592,7 +592,7 @@ class rcube_imap extends rcube_storage
* protected method for getting nr of messages
*
* @param string $folder Folder name
- * @param string $mode Mode for count [ALL|THREADS|UNSEEN|RECENT]
+ * @param string $mode Mode for count [ALL|THREADS|UNSEEN|RECENT|EXISTS]
* @param boolean $force Force reading from server and update cache
* @param boolean $status Enables storing folder status info (max UID/count),
* required for folder_status()
@@ -614,6 +614,10 @@ class rcube_imap extends rcube_storage
}
}
+ // EXISTS is a special alias for ALL, it allows to get the number
+ // of all messages in a folder also when search is active and with
+ // any skip_deleted setting
+
$a_folder_cache = $this->get_cache('messagecount');
// return cached value
@@ -644,7 +648,7 @@ class rcube_imap extends rcube_storage
$count = $this->conn->countRecent($folder);
}
// use SEARCH for message counting
- else if (!empty($this->options['skip_deleted'])) {
+ else if ($mode != 'EXISTS' && !empty($this->options['skip_deleted'])) {
$search_str = "ALL UNDELETED";
$keys = array('COUNT');
@@ -683,8 +687,8 @@ class rcube_imap extends rcube_storage
}
else {
$count = $this->conn->countMessages($folder);
- if ($status) {
- $this->set_folder_stats($folder,'cnt', $count);
+ if ($status && $mode == 'ALL') {
+ $this->set_folder_stats($folder, 'cnt', $count);
$this->set_folder_stats($folder, 'maxuid', $count ? $this->id2uid($count, $folder) : 0);
}
}
@@ -2226,10 +2230,11 @@ class rcube_imap extends rcube_storage
* @param boolean $is_file True if $message is a filename
* @param array $flags Message flags
* @param mixed $date Message internal date
+ * @param bool $binary Enables BINARY append
*
* @return int|bool Appended message UID or True on success, False on error
*/
- public function save_message($folder, &$message, $headers='', $is_file=false, $flags = array(), $date = null)
+ public function save_message($folder, &$message, $headers='', $is_file=false, $flags = array(), $date = null, $binary = false)
{
if (!strlen($folder)) {
$folder = $this->folder;
@@ -2247,10 +2252,10 @@ class rcube_imap extends rcube_storage
$date = $this->date_format($date);
if ($is_file) {
- $saved = $this->conn->appendFromFile($folder, $message, $headers, $flags, $date);
+ $saved = $this->conn->appendFromFile($folder, $message, $headers, $flags, $date, $binary);
}
else {
- $saved = $this->conn->append($folder, $message, $flags, $date);
+ $saved = $this->conn->append($folder, $message, $flags, $date, $binary);
}
if ($saved) {
diff --git a/program/lib/Roundcube/rcube_imap_generic.php b/program/lib/Roundcube/rcube_imap_generic.php
index 0f32d83d1..28d56c16f 100644
--- a/program/lib/Roundcube/rcube_imap_generic.php
+++ b/program/lib/Roundcube/rcube_imap_generic.php
@@ -2548,10 +2548,11 @@ class rcube_imap_generic
* @param string $message Message content
* @param array $flags Message flags
* @param string $date Message internal date
+ * @param bool $binary Enable BINARY append (RFC3516)
*
* @return string|bool On success APPENDUID response (if available) or True, False on failure
*/
- function append($mailbox, &$message, $flags = array(), $date = null)
+ function append($mailbox, &$message, $flags = array(), $date = null, $binary = false)
{
unset($this->data['APPENDUID']);
@@ -2559,8 +2560,13 @@ class rcube_imap_generic
return false;
}
- $message = str_replace("\r", '', $message);
- $message = str_replace("\n", "\r\n", $message);
+ $binary = $binary && $this->getCapability('BINARY');
+ $literal_plus = !$binary && $this->prefs['literal+'];
+
+ if (!$binary) {
+ $message = str_replace("\r", '', $message);
+ $message = str_replace("\n", "\r\n", $message);
+ }
$len = strlen($message);
if (!$len) {
@@ -2573,12 +2579,12 @@ class rcube_imap_generic
if (!empty($date)) {
$request .= ' ' . $this->escape($date);
}
- $request .= ' {' . $len . ($this->prefs['literal+'] ? '+' : '') . '}';
+ $request .= ' ' . ($binary ? '~' : '') . '{' . $len . ($literal_plus ? '+' : '') . '}';
// send APPEND command
if ($this->putLine($request)) {
// Do not wait when LITERAL+ is supported
- if (!$this->prefs['literal+']) {
+ if (!$literal_plus) {
$line = $this->readReply();
if ($line[0] != '+') {
@@ -2620,10 +2626,11 @@ class rcube_imap_generic
* @param string $headers Message headers
* @param array $flags Message flags
* @param string $date Message internal date
+ * @param bool $binary Enable BINARY append (RFC3516)
*
* @return string|bool On success APPENDUID response (if available) or True, False on failure
*/
- function appendFromFile($mailbox, $path, $headers=null, $flags = array(), $date = null)
+ function appendFromFile($mailbox, $path, $headers=null, $flags = array(), $date = null, $binary = false)
{
unset($this->data['APPENDUID']);
@@ -2654,18 +2661,21 @@ class rcube_imap_generic
$len += strlen($headers) + strlen($body_separator);
}
+ $binary = $binary && $this->getCapability('BINARY');
+ $literal_plus = !$binary && $this->prefs['literal+'];
+
// build APPEND command
$key = $this->nextTag();
$request = "$key APPEND " . $this->escape($mailbox) . ' (' . $this->flagsToStr($flags) . ')';
if (!empty($date)) {
$request .= ' ' . $this->escape($date);
}
- $request .= ' {' . $len . ($this->prefs['literal+'] ? '+' : '') . '}';
+ $request .= ' ' . ($binary ? '~' : '') . '{' . $len . ($literal_plus ? '+' : '') . '}';
// send APPEND command
if ($this->putLine($request)) {
// Don't wait when LITERAL+ is supported
- if (!$this->prefs['literal+']) {
+ if (!$literal_plus) {
$line = $this->readReply();
if ($line[0] != '+') {
diff --git a/program/lib/Roundcube/rcube_ldap.php b/program/lib/Roundcube/rcube_ldap.php
index c9a14d863..c32cea728 100644
--- a/program/lib/Roundcube/rcube_ldap.php
+++ b/program/lib/Roundcube/rcube_ldap.php
@@ -1455,6 +1455,7 @@ class rcube_ldap extends rcube_addressbook
if ($this->vlv_active && function_exists('ldap_parse_virtuallist_control')) {
if (ldap_parse_result($this->conn, $this->ldap_result,
$errcode, $matcheddn, $errmsg, $referrals, $serverctrls)
+ && $serverctrls // can be null e.g. in case of adm. limit error
) {
ldap_parse_virtuallist_control($this->conn, $serverctrls,
$last_offset, $this->vlv_count, $vresult);
diff --git a/program/lib/Roundcube/rcube_message.php b/program/lib/Roundcube/rcube_message.php
index 4ef534a0a..c626af08a 100644
--- a/program/lib/Roundcube/rcube_message.php
+++ b/program/lib/Roundcube/rcube_message.php
@@ -320,8 +320,15 @@ class rcube_message
private function parse_structure($structure, $recursive = false)
{
// real content-type of message/rfc822 part
- if ($structure->mimetype == 'message/rfc822' && $structure->real_mimetype)
+ if ($structure->mimetype == 'message/rfc822' && $structure->real_mimetype) {
$mimetype = $structure->real_mimetype;
+
+ // parse headers from message/rfc822 part
+ if (!isset($structure->headers['subject'])) {
+ list($headers, $dump) = explode("\r\n\r\n", $this->get_part_content($structure->mime_id, null, true, 4096));
+ $structure->headers = rcube_mime::parse_headers($headers);
+ }
+ }
else
$mimetype = $structure->mimetype;
diff --git a/program/lib/Roundcube/rcube_message_header.php b/program/lib/Roundcube/rcube_message_header.php
index 445d0bd39..7009a00af 100644
--- a/program/lib/Roundcube/rcube_message_header.php
+++ b/program/lib/Roundcube/rcube_message_header.php
@@ -235,6 +235,22 @@ class rcube_message_header
$this->others[$name] = $value;
}
}
+
+
+ /**
+ * Factory method to instantiate headers from a data array
+ *
+ * @param array Hash array with header values
+ * @return object rcube_message_header instance filled with headers values
+ */
+ public static function from_array($arr)
+ {
+ $obj = new rcube_message_header;
+ foreach ($arr as $k => $v)
+ $obj->set($k, $v);
+
+ return $obj;
+ }
}
diff --git a/program/lib/Roundcube/rcube_mime.php b/program/lib/Roundcube/rcube_mime.php
index 17cb3f015..4bb5b483f 100644
--- a/program/lib/Roundcube/rcube_mime.php
+++ b/program/lib/Roundcube/rcube_mime.php
@@ -717,6 +717,7 @@ class rcube_mime
$file_paths[] = $mime_types;
// try common locations
+ $file_paths[] = '/etc/mime.types';
$file_paths[] = '/etc/httpd/mime.types';
$file_paths[] = '/etc/httpd2/mime.types';
$file_paths[] = '/etc/apache/mime.types';
@@ -749,7 +750,7 @@ class rcube_mime
// fallback to some well-known types most important for daily emails
if (empty($mime_types)) {
$mime_extensions = @include(RCUBE_CONFIG_DIR . '/mimetypes.php');
- $mime_extensions += array('gif' => 'image/gif', 'png' => 'image/png', 'jpg' => 'image/jpg', 'jpeg' => 'image/jpeg', 'tif' => 'image/tiff');
+ $mime_extensions += array('gif' => 'image/gif', 'png' => 'image/png', 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'tif' => 'image/tiff');
foreach ($mime_extensions as $ext => $mime)
$mime_types[$mime][] = $ext;
diff --git a/program/lib/Roundcube/rcube_plugin.php b/program/lib/Roundcube/rcube_plugin.php
index dbb15e8be..5db85025d 100644
--- a/program/lib/Roundcube/rcube_plugin.php
+++ b/program/lib/Roundcube/rcube_plugin.php
@@ -203,23 +203,23 @@ abstract class rcube_plugin
foreach ($texts as $key => $value)
$add[$domain.'.'.$key] = $value;
- $rcmail = rcube::get_instance();
- $rcmail->load_language($lang, $add);
+ $rcube = rcube::get_instance();
+ $rcube->load_language($lang, $add);
// add labels to client
if ($add2client) {
$js_labels = is_array($add2client) ? array_map(array($this, 'label_map_callback'), $add2client) : array_keys($add);
- $rcmail->output->add_label($js_labels);
+ $rcube->output->add_label($js_labels);
}
}
}
/**
- * Wrapper for rcmail::gettext() adding the plugin ID as domain
+ * Wrapper for rcube::gettext() adding the plugin ID as domain
*
* @param string $p Message identifier
* @return string Localized text
- * @see rcmail::gettext()
+ * @see rcube::gettext()
*/
public function gettext($p)
{
@@ -336,8 +336,8 @@ abstract class rcube_plugin
*/
public function local_skin_path()
{
- $rcmail = rcube::get_instance();
- foreach (array($rcmail->config->get('skin'), 'larry') as $skin) {
+ $rcube = rcube::get_instance();
+ foreach (array($rcube->config->get('skin'), 'larry') as $skin) {
$skin_path = 'skins/' . $skin;
if (is_dir(realpath(slashify($this->home) . $skin_path)))
break;
diff --git a/program/lib/Roundcube/rcube_plugin_api.php b/program/lib/Roundcube/rcube_plugin_api.php
index 51cf5d246..47508a2ef 100644
--- a/program/lib/Roundcube/rcube_plugin_api.php
+++ b/program/lib/Roundcube/rcube_plugin_api.php
@@ -78,7 +78,8 @@ class rcube_plugin_api
'identity_save' => 'identity_update',
// to be removed after 0.8
'imap_init' => 'storage_init',
- 'mailboxes_list' => 'storage_folders',
+ 'mailboxes_list' => 'storage_folders',
+ 'imap_connect' => 'storage_connect',
);
/**
diff --git a/program/lib/Roundcube/rcube_storage.php b/program/lib/Roundcube/rcube_storage.php
index 245d911c0..763b9155e 100644
--- a/program/lib/Roundcube/rcube_storage.php
+++ b/program/lib/Roundcube/rcube_storage.php
@@ -65,6 +65,7 @@ abstract class rcube_storage
'MAIL-REPLY-TO',
'RETURN-PATH',
'DELIVERED-TO',
+ 'ENVELOPE-TO',
);
const UNKNOWN = 0;
@@ -353,7 +354,7 @@ abstract class rcube_storage
* Get messages count for a specific folder.
*
* @param string $folder Folder name
- * @param string $mode Mode for count [ALL|THREADS|UNSEEN|RECENT]
+ * @param string $mode Mode for count [ALL|THREADS|UNSEEN|RECENT|EXISTS]
* @param boolean $force Force reading from server and update cache
* @param boolean $status Enables storing folder status info (max UID/count),
* required for folder_status()
diff --git a/program/lib/Roundcube/rcube_user.php b/program/lib/Roundcube/rcube_user.php
index b027506ac..f6b77f5e1 100644
--- a/program/lib/Roundcube/rcube_user.php
+++ b/program/lib/Roundcube/rcube_user.php
@@ -263,7 +263,7 @@ class rcube_user
$sql_arr['email_ascii'] = $ascii_email;
$sql_arr['email'] = $utf8_email;
- $sql_arr['ident'] = format_email_recipient($ascii_email, $ident['name']);
+ $sql_arr['ident'] = format_email_recipient($ascii_email, $sql_arr['name']);
}
$result[] = $sql_arr;
diff --git a/program/lib/washtml.php b/program/lib/washtml.php
index 0d4ffdb4b..d13d66404 100644
--- a/program/lib/washtml.php
+++ b/program/lib/washtml.php
@@ -214,7 +214,7 @@ class washtml
$key = strtolower($key);
$value = $node->getAttribute($key);
if (isset($this->_html_attribs[$key]) ||
- ($key == 'href' && !preg_match('!^javascript!i', $value)
+ ($key == 'href' && !preg_match('!^(javascript|vbscript|data:text)!i', $value)
&& preg_match('!^([a-z][a-z0-9.+-]+:|//|#).+!i', $value))
) {
$t .= ' ' . $key . '="' . htmlspecialchars($value, ENT_QUOTES) . '"';