Aleksander Machniak
2015-06-07 a9587489473baf3854999e711083be212ca0c1c4
CS fixes
135 files modified
1431 ■■■■■ changed files
index.php 6 ●●●● patch | view | raw | blame | history
installer/index.php 2 ●●● patch | view | raw | blame | history
program/include/bc.php 2 ●●● patch | view | raw | blame | history
program/include/clisetup.php 2 ●●● patch | view | raw | blame | history
program/include/iniset.php 2 ●●● patch | view | raw | blame | history
program/include/rcmail.php 2 ●●● patch | view | raw | blame | history
program/include/rcmail_html_page.php 5 ●●●●● patch | view | raw | blame | history
program/include/rcmail_install.php 5 ●●●●● patch | view | raw | blame | history
program/include/rcmail_output.php 16 ●●●● patch | view | raw | blame | history
program/include/rcmail_output_cli.php 3 ●●●● patch | view | raw | blame | history
program/include/rcmail_output_html.php 4 ●●● patch | view | raw | blame | history
program/include/rcmail_output_json.php 26 ●●●● patch | view | raw | blame | history
program/include/rcmail_string_replacer.php 2 ●●● patch | view | raw | blame | history
program/include/rcmail_utils.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/bootstrap.php 16 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/html.php 65 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube.php 129 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_addressbook.php 42 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_base_replacer.php 31 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_browser.php 3 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_cache.php 20 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_cache_shared.php 20 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_charset.php 19 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_config.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_contacts.php 229 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_content_filter.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_csv2vcard.php 6 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_db.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_db_mssql.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_db_mysql.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_db_oracle.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_db_pgsql.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_db_sqlite.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_db_sqlsrv.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_enriched.php 9 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_html2text.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_image.php 7 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_imap.php 187 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_imap_cache.php 28 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_imap_generic.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_imap_search.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_ldap.php 34 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_ldap_generic.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_message.php 17 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_message_header.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_message_part.php 12 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_mime.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_output.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_plugin.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_plugin_api.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_result_index.php 19 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_result_multifolder.php 13 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_result_set.php 3 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_result_thread.php 25 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_session.php 45 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_session_db.php 29 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_session_memcache.php 3 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_session_php.php 5 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_session_redis.php 20 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_smtp.php 5 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_spellcheck_atd.php 4 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_spellcheck_enchant.php 4 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_spellcheck_engine.php 4 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_spellcheck_googie.php 4 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_spellcheck_pspell.php 4 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_spellchecker.php 14 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_storage.php 82 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_string_replacer.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_text2html.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_tnef_decoder.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_user.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_utils.php 23 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_vcard.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_washtml.php 2 ●●● patch | view | raw | blame | history
program/steps/addressbook/copy.inc 2 ●●● patch | view | raw | blame | history
program/steps/addressbook/delete.inc 2 ●●● patch | view | raw | blame | history
program/steps/addressbook/edit.inc 2 ●●● patch | view | raw | blame | history
program/steps/addressbook/export.inc 2 ●●● patch | view | raw | blame | history
program/steps/addressbook/func.inc 2 ●●● patch | view | raw | blame | history
program/steps/addressbook/groups.inc 2 ●●● patch | view | raw | blame | history
program/steps/addressbook/import.inc 2 ●●● patch | view | raw | blame | history
program/steps/addressbook/list.inc 2 ●●● patch | view | raw | blame | history
program/steps/addressbook/mailto.inc 2 ●●● patch | view | raw | blame | history
program/steps/addressbook/move.inc 2 ●●● patch | view | raw | blame | history
program/steps/addressbook/photo.inc 2 ●●● patch | view | raw | blame | history
program/steps/addressbook/print.inc 2 ●●● patch | view | raw | blame | history
program/steps/addressbook/save.inc 2 ●●● patch | view | raw | blame | history
program/steps/addressbook/search.inc 2 ●●● patch | view | raw | blame | history
program/steps/addressbook/show.inc 2 ●●● patch | view | raw | blame | history
program/steps/addressbook/undo.inc 2 ●●● patch | view | raw | blame | history
program/steps/addressbook/upload_photo.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/addcontact.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/attachments.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/autocomplete.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/check_recent.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/compose.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/copy.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/folders.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/func.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/get.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/getunread.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/headers.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/import.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/list.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/list_contacts.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/mark.inc 3 ●●●● patch | view | raw | blame | history
program/steps/mail/move_del.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/pagenav.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/search.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/search_contacts.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/sendmail.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/sendmdn.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/show.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/viewsource.inc 2 ●●● patch | view | raw | blame | history
program/steps/settings/about.inc 2 ●●● patch | view | raw | blame | history
program/steps/settings/edit_folder.inc 2 ●●● patch | view | raw | blame | history
program/steps/settings/edit_identity.inc 2 ●●● patch | view | raw | blame | history
program/steps/settings/edit_prefs.inc 2 ●●● patch | view | raw | blame | history
program/steps/settings/edit_response.inc 2 ●●● patch | view | raw | blame | history
program/steps/settings/folders.inc 2 ●●● patch | view | raw | blame | history
program/steps/settings/func.inc 2 ●●● patch | view | raw | blame | history
program/steps/settings/identities.inc 2 ●●● patch | view | raw | blame | history
program/steps/settings/responses.inc 2 ●●● patch | view | raw | blame | history
program/steps/settings/save_folder.inc 2 ●●● patch | view | raw | blame | history
program/steps/settings/save_identity.inc 2 ●●● patch | view | raw | blame | history
program/steps/settings/save_prefs.inc 2 ●●● patch | view | raw | blame | history
program/steps/settings/upload.inc 2 ●●● patch | view | raw | blame | history
program/steps/utils/error.inc 2 ●●● patch | view | raw | blame | history
program/steps/utils/html2text.inc 2 ●●● patch | view | raw | blame | history
program/steps/utils/killcache.inc 2 ●●● patch | view | raw | blame | history
program/steps/utils/modcss.inc 2 ●●● patch | view | raw | blame | history
program/steps/utils/save_pref.inc 2 ●●● patch | view | raw | blame | history
program/steps/utils/spell.inc 2 ●●● patch | view | raw | blame | history
program/steps/utils/spell_html.inc 3 ●●●● patch | view | raw | blame | history
program/steps/utils/text2html.inc 2 ●●● patch | view | raw | blame | history
index.php
@@ -1,5 +1,5 @@
<?php
/*
/**
 +-------------------------------------------------------------------------+
 | Roundcube Webmail IMAP Client                                           |
 | Version 1.2-git                                                         |
@@ -62,12 +62,12 @@
    rcmail::raise_error(array(
        'code' => 603,
        'type' => 'db',
        'message' => $err_str), FALSE, TRUE);
        'message' => $err_str), false, true);
}
// error steps
if ($RCMAIL->action == 'error' && !empty($_GET['_code'])) {
    rcmail::raise_error(array('code' => hexdec($_GET['_code'])), FALSE, TRUE);
    rcmail::raise_error(array('code' => hexdec($_GET['_code'])), false, true);
}
// check if https is required (for login) and redirect if necessary
installer/index.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-------------------------------------------------------------------------+
 | Roundcube Webmail setup tool                                            |
 | Version 1.2-git                                                         |
program/include/bc.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/include/bc.php                                                |
 |                                                                       |
program/include/clisetup.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/include/clisetup.php                                          |
 |                                                                       |
program/include/iniset.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/include/iniset.php                                            |
 |                                                                       |
program/include/rcmail.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/include/rcmail.php                                            |
 |                                                                       |
program/include/rcmail_html_page.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/include/rcmail_html_page.php                                  |
 |                                                                       |
@@ -19,11 +19,10 @@
 +-----------------------------------------------------------------------+
*/
/**
 * Class to create an empty HTML page with some default styles
 *
 * @package Webmail
 * @package    Webmail
 * @subpackage View
 */
class rcmail_html_page extends rcmail_output_html
program/include/rcmail_install.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | rcmail_install.php                                                    |
 |                                                                       |
@@ -13,13 +13,12 @@
 +-----------------------------------------------------------------------+
*/
/**
 * Class to control the installation process of the Roundcube Webmail package
 *
 * @category Install
 * @package  Roundcube
 * @author Thomas Bruederli
 * @author   Thomas Bruederli
 */
class rcmail_install
{
program/include/rcmail_output.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/include/rcmail_output.php                                     |
 |                                                                       |
@@ -30,11 +30,11 @@
    const JS_OBJECT_NAME = 'rcmail';
    const BLANK_GIF      = 'R0lGODlhDwAPAIAAAMDAwAAAACH5BAEAAAAALAAAAAAPAA8AQAINhI+py+0Po5y02otnAQA7';
    public $type = 'html';
    public $type      = 'html';
    public $ajax_call = false;
    public $framed = false;
    public $framed    = false;
    protected $pagetitle = '';
    protected $pagetitle       = '';
    protected $object_handlers = array();
@@ -46,7 +46,6 @@
        parent::__construct();
    }
    /**
     * Setter for page title
     *
@@ -57,7 +56,6 @@
        $this->pagetitle = $title;
    }
    /**
     * Getter for the current skin path property
     */
@@ -65,7 +63,6 @@
    {
        return $this->config->get('skin_path');
    }
    /**
     * Delete all stored env variables and commands
@@ -78,7 +75,6 @@
        $this->pagetitle = '';
    }
    /**
     * Call a client method
     *
@@ -87,12 +83,10 @@
     */
    abstract function command();
    /**
     * Add a localized label to the client environment
     */
    abstract function add_label();
    /**
     * Register a template object handler
@@ -106,7 +100,6 @@
        $this->object_handlers[$obj] = $func;
    }
    /**
     * Register a list of template object handlers
     *
@@ -117,5 +110,4 @@
    {
        $this->object_handlers = array_merge($this->object_handlers, $arr);
    }
}
program/include/rcmail_output_cli.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/include/rcmail_output_cli.php                                 |
 |                                                                       |
@@ -85,5 +85,4 @@
    {
        // NOP
    }
}
program/include/rcmail_output_html.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/include/rcmail_output_html.php                                |
 |                                                                       |
@@ -18,7 +18,6 @@
 | Author: Thomas Bruederli <roundcube@gmail.com>                        |
 +-----------------------------------------------------------------------+
*/
/**
 * Class to create HTML page output using a skin template
@@ -2035,5 +2034,4 @@
        return $content;
    }
}
program/include/rcmail_output_json.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/include/rcmail_output_json.php                                |
 |                                                                       |
@@ -19,7 +19,6 @@
 +-----------------------------------------------------------------------+
*/
/**
 * View class to produce JSON responses
 *
@@ -28,12 +27,12 @@
 */
class rcmail_output_json extends rcmail_output
{
    protected $texts = array();
    protected $commands = array();
    protected $texts     = array();
    protected $commands  = array();
    protected $callbacks = array();
    protected $message = null;
    protected $message   = null;
    public $type = 'js';
    public $type      = 'js';
    public $ajax_call = true;
@@ -49,9 +48,8 @@
        else
            $name = $this->config->get('product_name');
        $this->command('set_pagetitle', empty($name) ? $title : $name.' :: '.$title);
        $this->command('set_pagetitle', empty($name) ? $title : $name . ' :: ' . $title);
    }
    /**
     * Register a template object handler
@@ -64,7 +62,6 @@
        // ignore
    }
    /**
     * Register a list of template object handlers
     *
@@ -74,7 +71,6 @@
    {
        // ignore
    }
    /**
     * Call a client method
@@ -92,7 +88,6 @@
          $this->commands[] = $cmd;
    }
    /**
     * Add a localized label to the client environment
     */
@@ -106,7 +101,6 @@
            $this->texts[$name] = $this->app->gettext($name);
        }
    }
    /**
     * Invoke display_message command
@@ -135,17 +129,15 @@
        }
    }
    /**
     * Delete all stored env variables and commands
     */
    public function reset()
    {
        parent::reset();
        $this->texts = array();
        $this->texts    = array();
        $this->commands = array();
    }
    /**
     * Redirect to a certain url
@@ -162,7 +154,6 @@
        exit;
    }
    /**
     * Send an AJAX response to the client.
     */
@@ -171,7 +162,6 @@
        $this->remote_response();
        exit;
    }
    /**
     * Show error page and terminate script execution
@@ -190,7 +180,6 @@
        $this->remote_response();
        exit;
    }
    /**
     * Send an AJAX response with executable JS code
@@ -241,7 +230,6 @@
        echo self::json_serialize($response);
    }
    /**
     * Return executable javascript code for all registered commands
program/include/rcmail_string_replacer.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/include/rcmail_string_replacer.php                            |
 |                                                                       |
program/include/rcmail_utils.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/include/rcmail_utils.php                                      |
 |                                                                       |
program/lib/Roundcube/bootstrap.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube PHP suite                          |
 | Copyright (C) 2005-2015, The Roundcube Dev Team                       |
@@ -16,7 +16,6 @@
 | Author: Aleksander Machniak <alec@alec.pl>                            |
 +-----------------------------------------------------------------------+
*/
/**
 * Roundcube Framework Initialization
@@ -124,7 +123,6 @@
    return false;
}
/**
 * Parse a human readable string for a number of bytes.
 *
@@ -159,7 +157,6 @@
    return floatval($bytes);
}
/**
 * Make sure the string ends with a slash
 */
@@ -168,7 +165,6 @@
  return unslashify($str).'/';
}
/**
 * Remove slashes at the end of the string
 */
@@ -176,7 +172,6 @@
{
  return preg_replace('/\/+$/', '', $str);
}
/**
 * Returns number of seconds for a specified offset string.
@@ -210,7 +205,6 @@
    return $amount;
}
/**
 * Create a unix timestamp with a specified offset from now.
 *
@@ -223,7 +217,6 @@
{
    return time() + get_offset_sec($offset_str) * $factor;
}
/**
 * Truncate string if it is longer than the allowed length.
@@ -255,7 +248,6 @@
    return $str;
}
/**
 * Get all keys from array (recursive).
 *
@@ -279,7 +271,6 @@
    return $keys;
}
/**
 * Remove all non-ascii and non-word chars except ., -, _
 */
@@ -288,7 +279,6 @@
    $allowed = 'a-z0-9\_\-' . (!$css_id ? '\.' : '');
    return preg_replace("/[^$allowed]/i", $replace_with, $str);
}
/**
 * Check if a string contains only ascii characters
@@ -303,7 +293,6 @@
    $regexp = $control_chars ? '/[^\x00-\x7F]/' : '/[^\x20-\x7E]/';
    return preg_match($regexp, $str) ? false : true;
}
/**
 * Compose a valid representation of name and e-mail address
@@ -329,7 +318,6 @@
    return $email;
}
/**
 * Format e-mail address
 *
@@ -352,7 +340,6 @@
    return $email;
}
/**
 * Fix version number so it can be used correctly in version_compare()
 *
@@ -367,7 +354,6 @@
        array('.0', '.99'),
        $version);
}
/**
 * mbstring replacement functions
program/lib/Roundcube/html.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2013, The Roundcube Dev Team                       |
@@ -16,7 +16,6 @@
 +-----------------------------------------------------------------------+
*/
/**
 * Class for HTML code creation
 *
@@ -26,7 +25,7 @@
class html
{
    protected $tagname;
    protected $attrib = array();
    protected $attrib  = array();
    protected $allowed = array();
    protected $content;
@@ -66,13 +65,15 @@
     * @param string $tagname Tag name
     * @param array  $attrib  Tag attributes as key/value pairs
     * @param string $content Optinal Tag content (creates a container tag)
     * @param array  $allowed_attrib List with allowed attributes, omit to allow all
     * @param array  $allowed List with allowed attributes, omit to allow all
     *
     * @return string The XHTML tag
     */
    public static function tag($tagname, $attrib = array(), $content = null, $allowed_attrib = null)
    public static function tag($tagname, $attrib = array(), $content = null, $allowed = null)
    {
        if (is_string($attrib))
        if (is_string($attrib)) {
            $attrib = array('class' => $attrib);
        }
        $inline_tags = array('a','span','img');
        $suffix = $attrib['nl'] || ($content && $attrib['nl'] !== false && !in_array($tagname, $inline_tags)) ? "\n" : '';
@@ -81,15 +82,17 @@
        if (isset($content) || in_array($tagname, self::$containers)) {
            $suffix = $attrib['noclose'] ? $suffix : '</' . $tagname . '>' . $suffix;
            unset($attrib['noclose'], $attrib['nl']);
            return '<' . $tagname  . self::attrib_string($attrib, $allowed_attrib) . '>' . $content . $suffix;
            return '<' . $tagname  . self::attrib_string($attrib, $allowed) . '>' . $content . $suffix;
        }
        else {
            return '<' . $tagname  . self::attrib_string($attrib, $allowed_attrib) . '>' . $suffix;
            return '<' . $tagname  . self::attrib_string($attrib, $allowed) . '>' . $suffix;
        }
    }
    /**
     * Return DOCTYPE tag of specified type
     *
     * @param string $type Document type (html5, xhtml, 'xhtml-trans, xhtml-strict)
     */
    public static function doctype($type)
    {
@@ -113,6 +116,7 @@
     *
     * @param mixed  $attr Hash array with tag attributes or string with class name
     * @param string $cont Div content
     *
     * @return string HTML code
     * @see html::tag()
     */
@@ -121,6 +125,7 @@
        if (is_string($attr)) {
            $attr = array('class' => $attr);
        }
        return self::tag('div', $attr, $cont, array_merge(self::$common_attrib, array('onclick')));
    }
@@ -129,6 +134,7 @@
     *
     * @param mixed  $attr Hash array with tag attributes or string with class name
     * @param string $cont Paragraph content
     *
     * @return string HTML code
     * @see html::tag()
     */
@@ -137,6 +143,7 @@
        if (is_string($attr)) {
            $attr = array('class' => $attr);
        }
        return self::tag('p', $attr, $cont, self::$common_attrib);
    }
@@ -144,6 +151,7 @@
     * Derrived method to create <img />
     *
     * @param mixed $attr Hash array with tag attributes or string with image source (src)
     *
     * @return string HTML code
     * @see html::tag()
     */
@@ -152,6 +160,7 @@
        if (is_string($attr)) {
            $attr = array('src' => $attr);
        }
        return self::tag('img', $attr + array('alt' => ''), null, array_merge(self::$common_attrib,
            array('src','alt','width','height','border','usemap','onclick','onerror')));
    }
@@ -161,6 +170,7 @@
     *
     * @param mixed  $attr Hash array with tag attributes or string with link location (href)
     * @param string $cont Link content
     *
     * @return string HTML code
     * @see html::tag()
     */
@@ -169,6 +179,7 @@
        if (is_string($attr)) {
            $attr = array('href' => $attr);
        }
        return self::tag('a', $attr, $cont, array_merge(self::$common_attrib,
            array('href','target','name','rel','onclick','onmouseover','onmouseout','onmousedown','onmouseup')));
    }
@@ -178,6 +189,7 @@
     *
     * @param mixed  $attr Hash array with tag attributes or string with class name
     * @param string $cont Tag content
     *
     * @return string HTML code
     * @see html::tag()
     */
@@ -186,6 +198,7 @@
        if (is_string($attr)) {
            $attr = array('class' => $attr);
        }
        return self::tag('span', $attr, $cont, self::$common_attrib);
    }
@@ -194,6 +207,7 @@
     *
     * @param mixed  $attr Hash array with tag attributes or string with 'for' attrib
     * @param string $cont Tag content
     *
     * @return string HTML code
     * @see html::tag()
     */
@@ -202,6 +216,7 @@
        if (is_string($attr)) {
            $attr = array('for' => $attr);
        }
        return self::tag('label', $attr, $cont, array_merge(self::$common_attrib, array('for')));
    }
@@ -209,6 +224,7 @@
     * Derrived method to create <iframe></iframe>
     *
     * @param mixed $attr Hash array with tag attributes or string with frame source (src)
     *
     * @return string HTML code
     * @see html::tag()
     */
@@ -217,6 +233,7 @@
        if (is_string($attr)) {
            $attr = array('src' => $attr);
        }
        return self::tag('iframe', $attr, $cont, array_merge(self::$common_attrib,
            array('src','name','width','height','border','frameborder','onload','allowfullscreen')));
    }
@@ -224,8 +241,9 @@
    /**
     * Derrived method to create <script> tags
     *
     * @param mixed $attr Hash array with tag attributes or string with script source (src)
     * @param mixed  $attr Hash array with tag attributes or string with script source (src)
     * @param string $cont Javascript code to be placed as tag content
     *
     * @return string HTML code
     * @see html::tag()
     */
@@ -248,6 +266,8 @@
    /**
     * Derrived method for line breaks
     *
     * @param array $attrib  Associative arry with tag attributes
     *
     * @return string HTML code
     * @see html::tag()
     */
@@ -259,8 +279,9 @@
    /**
     * Create string with attributes
     *
     * @param array $attrib Associative arry with tag attributes
     * @param array $attrib  Associative arry with tag attributes
     * @param array $allowed List of allowed attributes
     *
     * @return string Valid attribute string
     */
    public static function attrib_string($attrib = array(), $allowed = null)
@@ -315,6 +336,7 @@
     * Convert a HTML attribute string attributes to an associative array (name => value)
     *
     * @param string Input string
     *
     * @return array Key-value pairs of parsed attributes
     */
    public static function parse_attrib_string($str)
@@ -366,7 +388,7 @@
class html_inputfield extends html
{
    protected $tagname = 'input';
    protected $type = 'text';
    protected $type    = 'text';
    protected $allowed = array(
        'type','name','value','size','tabindex','autocapitalize','required',
        'autocomplete','checked','onchange','onclick','disabled','readonly',
@@ -393,8 +415,9 @@
    /**
     * Compose input tag
     *
     * @param string $value Field value
     * @param string $value  Field value
     * @param array  $attrib Additional attributes to override
     *
     * @return string HTML output
     */
    public function show($value = null, $attrib = null)
@@ -410,6 +433,7 @@
        }
        // set type
        $this->attrib['type'] = $this->type;
        return parent::show();
    }
}
@@ -434,9 +458,9 @@
class html_hiddenfield extends html
{
    protected $tagname = 'input';
    protected $type = 'hidden';
    protected $fields_arr = array();
    protected $type    = 'hidden';
    protected $allowed = array('type','name','value','onchange','disabled','readonly');
    protected $fields_arr = array();
    /**
     * Constructor
@@ -471,6 +495,7 @@
        foreach ($this->fields_arr as $attrib) {
            $out .= self::tag($this->tagname, array('type' => $this->type) + $attrib);
        }
        return $out;
    }
}
@@ -490,6 +515,7 @@
     *
     * @param string $value  Value of the checked field
     * @param array  $attrib Additional attributes to override
     *
     * @return string HTML output
     */
    public function show($value = '', $attrib = null)
@@ -521,6 +547,7 @@
     *
     * @param string $value  Value of the checked field
     * @param array  $attrib Additional attributes to override
     *
     * @return string HTML output
     */
    public function show($value = '', $attrib = null)
@@ -554,6 +581,7 @@
     *
     * @param string $value  Textbox value
     * @param array  $attrib Additional attributes to override
     *
     * @return string HTML output
     */
    public function show($value = '', $attrib = null)
@@ -633,6 +661,7 @@
     *
     * @param string $select Value of the selection option
     * @param array  $attrib Additional attributes to override
     *
     * @return string HTML output
     */
    public function show($select = array(), $attrib = null)
@@ -675,8 +704,8 @@
    protected $allowed = array('id','class','style','width','summary',
        'cellpadding','cellspacing','border');
    private $header = array();
    private $rows = array();
    private $header   = array();
    private $rows     = array();
    private $rowindex = 0;
    private $colindex = 0;
@@ -776,7 +805,7 @@
        $this->colindex = 0;
        $this->rows[$this->rowindex] = new stdClass;
        $this->rows[$this->rowindex]->attrib = $attr;
        $this->rows[$this->rowindex]->cells = array();
        $this->rows[$this->rowindex]->cells  = array();
    }
    /**
@@ -823,6 +852,7 @@
     * Build HTML output of the table data
     *
     * @param array $attrib Table attributes
     *
     * @return string The final table HTML code
     */
    public function show($attrib = null)
@@ -910,5 +940,4 @@
        static $col_tagnames = array('table' => 'td', '*' => 'span');
        return $col_tagnames[$this->tagname] ?: $col_tagnames['*'];
    }
}
program/lib/Roundcube/rcube.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2008-2014, The Roundcube Dev Team                       |
@@ -17,7 +17,6 @@
 | Author: Thomas Bruederli <roundcube@gmail.com>                        |
 +-----------------------------------------------------------------------+
*/
/**
 * Base class of the Roundcube Framework
@@ -140,7 +139,6 @@
        return self::$instance;
    }
    /**
     * Private constructor
     */
@@ -152,7 +150,6 @@
        register_shutdown_function(array($this, 'shutdown'));
    }
    /**
     * Initial startup function
@@ -177,7 +174,6 @@
        }
    }
    /**
     * Get the current database connection
     *
@@ -197,7 +193,6 @@
        return $this->db;
    }
    /**
     * Get global handle for memcache access
@@ -245,7 +240,6 @@
        return $this->memcache;
    }
    /**
     * Callback for memcache failure
     */
@@ -263,7 +257,6 @@
                true, false);
        }
    }
    /**
     * Initialize and get cache object
@@ -283,7 +276,6 @@
        return $this->caches[$name];
    }
    /**
     * Initialize and get shared cache object
@@ -317,11 +309,10 @@
        return $this->caches[$shared_name];
    }
    /**
     * Create SMTP object and connect to server
     *
     * @param boolean True if connection should be established
     * @param boolean $connect True if connection should be established
     */
    public function smtp_init($connect = false)
    {
@@ -331,7 +322,6 @@
            $this->smtp->connect();
        }
    }
    /**
     * Initialize and get storage object
@@ -347,7 +337,6 @@
        return $this->storage;
    }
    /**
     * Initialize storage object
@@ -447,7 +436,6 @@
        }
    }
    /**
     * Set special folders type association.
     * This must be done AFTER connecting to the server!
@@ -476,7 +464,6 @@
            $storage->create_default_folders();
        }
    }
    /**
     * Callback for IMAP connection events to log session identifiers
@@ -545,7 +532,6 @@
        $this->gc_temp();
    }
    /**
     * Garbage collector function for temp files.
     * Remove temp files older than two days
@@ -577,7 +563,6 @@
        }
    }
    /**
     * Runs garbage collector with probability based on
     * session settings. This is intended for environments
@@ -595,7 +580,6 @@
            }
        }
    }
    /**
     * Get localized text in the desired language
@@ -653,7 +637,6 @@
        return strtr($text, array('\n' => "\n"));
    }
    /**
     * Check if the given text label exists
     *
@@ -692,7 +675,6 @@
        return false;
    }
    /**
     * Load a localization package
@@ -748,11 +730,10 @@
        }
    }
    /**
     * Check the given string and return a valid language code
     *
     * @param string Language code
     * @param string $lang Language code
     *
     * @return string Valid language code
     */
@@ -799,7 +780,6 @@
        return $lang;
    }
    /**
     * Read directory program/localization and return a list of available languages
     *
@@ -829,13 +809,12 @@
        return $sa_languages;
    }
    /**
     * Encrypt using 3DES
     *
     * @param string $clear clear text input
     * @param string $key encryption key to retrieve from the configuration, defaults to 'des_key'
     * @param boolean $base64 whether or not to base64_encode() the result before returning
     * @param string  $clear  Clear text input
     * @param string  $key    Encryption key to retrieve from the configuration, defaults to 'des_key'
     * @param boolean $base64 Whether or not to base64_encode() the result before returning
     *
     * @return string encrypted text
     */
@@ -845,11 +824,9 @@
            return '';
        }
        /*-
         * Add a single canary byte to the end of the clear text, which
         * will help find out how much of padding will need to be removed
         * upon decryption; see http://php.net/mcrypt_generic#68082
         */
        // Add a single canary byte to the end of the clear text, which
        // will help find out how much of padding will need to be removed
        // upon decryption; see http://php.net/mcrypt_generic#68082.
        $clear = pack("a*H2", $clear, "80");
        $ckey  = $this->config->get_crypto_key($key);
@@ -888,13 +865,12 @@
        return $base64 ? base64_encode($cipher) : $cipher;
    }
    /**
     * Decrypt 3DES-encrypted string
     *
     * @param string $cipher encrypted text
     * @param string $key encryption key to retrieve from the configuration, defaults to 'des_key'
     * @param boolean $base64 whether or not input is base64-encoded
     * @param string  $cipher Encrypted text
     * @param string  $key    Encryption key to retrieve from the configuration, defaults to 'des_key'
     * @param boolean $base64 Whether or not input is base64-encoded
     *
     * @return string decrypted text
     */
@@ -956,20 +932,17 @@
            }
        }
        /*-
         * Trim PHP's padding and the canary byte; see note in
         * rcube::encrypt() and http://php.net/mcrypt_generic#68082
         */
        // Trim PHP's padding and the canary byte; see note in
        // rcube::encrypt() and http://php.net/mcrypt_generic#68082
        $clear = substr(rtrim($clear, "\0"), 0, -1);
        return $clear;
    }
    /**
     * Generates encryption initialization vector (IV)
     *
     * @param int Vector size
     * @param int $size Vector size
     *
     * @return string Vector string
     */
@@ -984,7 +957,6 @@
        return $iv;
    }
    /**
     * Returns session token for secure URLs
@@ -1013,7 +985,6 @@
        return false;
    }
    /**
     * Generate a unique token to be used in a form request
     *
@@ -1032,12 +1003,11 @@
        return $plugin['value'];
    }
    /**
     * Check if the current request contains a valid token.
     * Empty requests aren't checked until use_secure_urls is set.
     *
     * @param int Request method
     * @param int $mode Request method
     *
     * @return boolean True if request token is valid false if not
     */
@@ -1082,11 +1052,11 @@
        return true;
    }
    /**
     * Build a valid URL to this instance of Roundcube
     *
     * @param mixed Either a string with the action or url parameters as key-value pairs
     * @param mixed $p Either a string with the action or url parameters as key-value pairs
     *
     * @return string Valid application URL
     */
    public function url($p)
@@ -1094,7 +1064,6 @@
        // STUB: should be overloaded by the application
        return '';
    }
    /**
     * Function to be executed in script shutdown
@@ -1129,7 +1098,6 @@
        }
    }
    /**
     * Registers shutdown function to be executed on shutdown.
     * The functions will be executed before destroying any
@@ -1142,7 +1110,6 @@
        $this->shutdown_functions[] = $function;
    }
    /**
     * Quote a given string.
     * Shortcut function for rcube_utils::rep_specialchars_output()
@@ -1153,7 +1120,6 @@
    {
        return rcube_utils::rep_specialchars_output($str, 'html', $mode, $newlines);
    }
    /**
     * Quote a given string for javascript output.
@@ -1166,12 +1132,11 @@
        return rcube_utils::rep_specialchars_output($str, 'js');
    }
    /**
     * Construct shell command, execute it and return output as string.
     * Keywords {keyword} are replaced with arguments
     *
     * @param $cmd Format string with {keywords} to be replaced
     * @param $cmd    Format string with {keywords} to be replaced
     * @param $values (zero, one or more arrays can be passed)
     *
     * @return output of command. shell errors not detectable
@@ -1219,7 +1184,6 @@
        return (string)shell_exec($cmd);
    }
    /**
     * Print or write debug messages
     *
@@ -1230,12 +1194,13 @@
        $args = func_get_args();
        if (class_exists('rcube', false)) {
            $rcube = self::get_instance();
            $rcube  = self::get_instance();
            $plugin = $rcube->plugins->exec_hook('console', array('args' => $args));
            if ($plugin['abort']) {
                return;
            }
           $args = $plugin['args'];
            $args = $plugin['args'];
        }
        $msg = array();
@@ -1246,13 +1211,12 @@
        self::write_log('console', join(";\n", $msg));
    }
    /**
     * Append a line to a logfile in the logs directory.
     * Date will be added automatically to the line.
     *
     * @param $name name of log file
     * @param line Line to append
     * @param string $name Name of the log file
     * @param mixed  $line Line to append
     */
    public static function write_log($name, $line)
    {
@@ -1330,18 +1294,17 @@
        return false;
    }
    /**
     * Throw system error (and show error page).
     *
     * @param array Named parameters
     * @param array $arg Named parameters
     *      - code:    Error code (required)
     *      - type:    Error type [php|db|imap|javascript] (required)
     *      - message: Error message
     *      - file:    File where error occurred
     *      - line:    Line where error occurred
     * @param boolean True to log the error
     * @param boolean Terminate script execution
     * @param boolean $log       True to log the error
     * @param boolean $terminate Terminate script execution
     */
    public static function raise_error($arg = array(), $log = false, $terminate = false)
    {
@@ -1393,11 +1356,10 @@
        }
    }
    /**
     * Report error according to configured debug_level
     *
     * @param array Named parameters
     * @param array $arg_arr Named parameters
     * @see self::raise_error()
     */
    public static function log_bug($arg_arr)
@@ -1452,13 +1414,12 @@
        }
    }
    /**
     * Write debug info to the log
     *
     * @param string Engine type - file name (memcache, apc)
     * @param string Data string to log
     * @param bool   Operation result
     * @param string $engine Engine type - file name (memcache, apc)
     * @param string $data   Data string to log
     * @param bool   $result Operation result
     */
    public static function debug($engine, $data, $result = null)
    {
@@ -1478,7 +1439,6 @@
        self::write_log($engine, $line);
    }
    /**
     * Returns current time (with microseconds).
     *
@@ -1489,13 +1449,12 @@
        return microtime(true);
    }
    /**
     * Logs time difference according to provided timer
     *
     * @param float  $timer  Timer (self::timer() result)
     * @param string $label  Log line prefix
     * @param string $dest   Log file name
     * @param float  $timer Timer (self::timer() result)
     * @param string $label Log line prefix
     * @param string $dest  Log file name
     *
     * @see self::timer()
     */
@@ -1546,7 +1505,6 @@
        return null;
    }
    /**
     * Getter for logged user name.
     *
@@ -1562,7 +1520,6 @@
        }
    }
    /**
     * Getter for logged user email (derived from user name not identity).
     *
@@ -1574,7 +1531,6 @@
            return $this->user->get_username('mail');
        }
    }
    /**
     * Getter for logged user password.
@@ -1644,13 +1600,13 @@
    /**
     * Send the given message using the configured method.
     *
     * @param object $message    Reference to Mail_MIME object
     * @param string $from       Sender address string
     * @param array  $mailto     Array of recipient address strings
     * @param array  $error      SMTP error array (reference)
     * @param string $body_file  Location of file with saved message body (reference),
     *                           used when delay_file_io is enabled
     * @param array  $options    SMTP options (e.g. DSN request)
     * @param object $message   Reference to Mail_MIME object
     * @param string $from      Sender address string
     * @param array  $mailto    Array of recipient address strings
     * @param array  $error     SMTP error array (reference)
     * @param string $body_file Location of file with saved message body (reference),
     *                          used when delay_file_io is enabled
     * @param array  $options   SMTP options (e.g. DSN request)
     *
     * @return boolean Send status.
     */
@@ -1821,14 +1777,13 @@
        return $sent;
    }
}
/**
 * Lightweight plugin API class serving as a dummy if plugins are not enabled
 *
 * @package Framework
 * @package    Framework
 * @subpackage Core
 */
class rcube_dummy_plugin_api
program/lib/Roundcube/rcube_addressbook.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2006-2013, The Roundcube Dev Team                       |
@@ -16,7 +16,6 @@
 +-----------------------------------------------------------------------+
*/
/**
 * Abstract skeleton of an address book/repository
 *
@@ -26,27 +25,32 @@
abstract class rcube_addressbook
{
    /** constants for error reporting **/
    const ERROR_READ_ONLY = 1;
    const ERROR_READ_ONLY     = 1;
    const ERROR_NO_CONNECTION = 2;
    const ERROR_VALIDATE = 3;
    const ERROR_SAVING = 4;
    const ERROR_SEARCH = 5;
    const ERROR_VALIDATE      = 3;
    const ERROR_SAVING        = 4;
    const ERROR_SEARCH        = 5;
    /** public properties (mandatory) */
    public $primary_key;
    public $groups = false;
    public $groups        = false;
    public $export_groups = true;
    public $readonly = true;
    public $searchonly = false;
    public $undelete = false;
    public $ready = false;
    public $group_id = null;
    public $list_page = 1;
    public $page_size = 10;
    public $sort_col = 'name';
    public $sort_order = 'ASC';
    public $coltypes = array('name' => array('limit'=>1), 'firstname' => array('limit'=>1), 'surname' => array('limit'=>1), 'email' => array('limit'=>1));
    public $date_cols = array();
    public $readonly      = true;
    public $searchonly    = false;
    public $undelete      = false;
    public $ready         = false;
    public $group_id      = null;
    public $list_page     = 1;
    public $page_size     = 10;
    public $sort_col      = 'name';
    public $sort_order    = 'ASC';
    public $date_cols     = array();
    public $coltypes      = array(
        'name'      => array('limit'=>1),
        'firstname' => array('limit'=>1),
        'surname'   => array('limit'=>1),
        'email'     => array('limit'=>1)
    );
    protected $error;
@@ -685,6 +689,4 @@
        return false;
    }
}
program/lib/Roundcube/rcube_base_replacer.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2012, The Roundcube Dev Team                       |
@@ -29,27 +29,44 @@
    private $base_url;
    /**
     * Class constructor
     *
     * @param string $base Base URL
     */
    public function __construct($base)
    {
        $this->base_url = $base;
    }
    /**
     * Replace callback
     *
     * @param array $matches Matching entries
     *
     * @return string Replaced text with absolute URL
     */
    public function callback($matches)
    {
        return $matches[1] . '="' . self::absolute_url($matches[3], $this->base_url) . '"';
    }
    /**
     * Convert base URLs to absolute ones
     *
     * @param string $body Text body
     *
     * @return string Replaced text
     */
    public function replace($body)
    {
        return preg_replace_callback(array(
        $regexp = array(
            '/(src|background|href)=(["\']?)([^"\'\s>]+)(\2|\s|>)/i',
            '/(url\s*\()(["\']?)([^"\'\)\s]+)(\2)\)/i',
        ),
        array($this, 'callback'), $body);
    }
        );
        return preg_replace_callback($regexp, array($this, 'callback'), $body);
    }
    /**
     * Convert paths like ../xxx to an absolute path using a base url
program/lib/Roundcube/rcube_browser.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2007-2009, The Roundcube Dev Team                       |
@@ -65,4 +65,3 @@
        $this->imgdata  = !$this->ie;
    }
}
program/lib/Roundcube/rcube_cache.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2011, The Roundcube Dev Team                            |
@@ -17,7 +17,6 @@
 | Author: Aleksander Machniak <alec@alec.pl>                            |
 +-----------------------------------------------------------------------+
*/
/**
 * Interface class for accessing Roundcube cache
@@ -92,7 +91,6 @@
        $this->prefix    = $prefix;
    }
    /**
     * Returns cached value.
     *
@@ -109,7 +107,6 @@
        return $this->cache[$key];
    }
    /**
     * Sets (add/update) value in cache.
     *
@@ -121,7 +118,6 @@
        $this->cache[$key]         = $data;
        $this->cache_changes[$key] = true;
    }
    /**
     * Returns cached value without storing it in internal memory.
@@ -139,7 +135,6 @@
        return $this->read_record($key, true);
    }
    /**
     * Sets (add/update) value in cache and immediately saves
     * it in the backend, no internal memory will be used.
@@ -153,7 +148,6 @@
    {
        return $this->write_record($key, $this->serialize($data));
    }
    /**
     * Clears the cache.
@@ -191,7 +185,6 @@
        $this->remove_record($key, $prefix_mode);
    }
    /**
     * Remove cache records older than ttl
     */
@@ -208,7 +201,6 @@
        }
    }
    /**
     * Remove expired records of all caches
     */
@@ -219,7 +211,6 @@
        $db->query("DELETE FROM " . $db->table_name('cache', true) . " WHERE `expires` < " . $db->now());
    }
    /**
     * Writes the cache back to the DB.
@@ -243,7 +234,6 @@
            $this->write_index();
        }
    }
    /**
     * Reads cache entry.
@@ -330,7 +320,6 @@
        return $this->cache[$key];
    }
    /**
     * Writes single cache record into DB.
     *
@@ -408,7 +397,6 @@
        return $this->db->affected_rows($result);
    }
    /**
     * Deletes the cache record(s).
     *
@@ -473,7 +461,6 @@
            $this->userid);
    }
    /**
     * Adds entry into memcache/apc DB.
     *
@@ -506,7 +493,6 @@
        return $result;
    }
    /**
     * Deletes entry from memcache/apc DB.
     *
@@ -530,7 +516,6 @@
        return $result;
    }
    /**
     * Writes the index entry into memcache/apc DB.
@@ -561,7 +546,6 @@
        $this->add_record($this->ikey(), $data);
    }
    /**
     * Gets the index entry from memcache/apc DB.
     */
@@ -591,7 +575,6 @@
        $this->index = $data ? unserialize($data) : array();
    }
    /**
     * Creates per-user cache key name (for memcache and apc)
     *
@@ -603,7 +586,6 @@
    {
        return sprintf('%d:%s:%s', $this->userid, $this->prefix, $key);
    }
    /**
     * Creates per-user index cache key name (for memcache and apc)
program/lib/Roundcube/rcube_cache_shared.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2011-2013, The Roundcube Dev Team                       |
@@ -17,7 +17,6 @@
 | Author: Aleksander Machniak <alec@alec.pl>                            |
 +-----------------------------------------------------------------------+
*/
/**
 * Interface class for accessing Roundcube shared cache
@@ -89,7 +88,6 @@
        $this->prefix    = $prefix;
    }
    /**
     * Returns cached value.
     *
@@ -106,7 +104,6 @@
        return $this->cache[$key];
    }
    /**
     * Sets (add/update) value in cache.
     *
@@ -118,7 +115,6 @@
        $this->cache[$key]         = $data;
        $this->cache_changes[$key] = true;
    }
    /**
     * Returns cached value without storing it in internal memory.
@@ -136,7 +132,6 @@
        return $this->read_record($key, true);
    }
    /**
     * Sets (add/update) value in cache and immediately saves
     * it in the backend, no internal memory will be used.
@@ -150,7 +145,6 @@
    {
        return $this->write_record($key, $this->serialize($data));
    }
    /**
     * Clears the cache.
@@ -188,7 +182,6 @@
        $this->remove_record($key, $prefix_mode);
    }
    /**
     * Remove cache records older than ttl
     */
@@ -203,7 +196,6 @@
        }
    }
    /**
     * Remove expired records of all caches
     */
@@ -214,7 +206,6 @@
        $db->query("DELETE FROM " . $db->table_name('cache_shared', true) . " WHERE `expires` < " . $db->now());
    }
    /**
     * Writes the cache back to the DB.
@@ -238,7 +229,6 @@
            $this->write_index();
        }
    }
    /**
     * Reads cache entry.
@@ -324,7 +314,6 @@
        return $this->cache[$key];
    }
    /**
     * Writes single cache record into DB.
     *
@@ -397,7 +386,6 @@
        return $this->db->affected_rows($result);
    }
    /**
     * Deletes the cache record(s).
     *
@@ -460,7 +448,6 @@
        $this->db->query("DELETE FROM " . $this->table . $where);
    }
    /**
     * Adds entry into memcache/apc DB.
     *
@@ -493,7 +480,6 @@
        return $result;
    }
    /**
     * Deletes entry from memcache/apc DB.
     *
@@ -517,7 +503,6 @@
        return $result;
    }
    /**
     * Writes the index entry into memcache/apc DB.
@@ -548,7 +533,6 @@
        $this->add_record($this->ikey(), $data);
    }
    /**
     * Gets the index entry from memcache/apc DB.
     */
@@ -578,7 +562,6 @@
        $this->index = $data ? unserialize($data) : array();
    }
    /**
     * Creates cache key name (for memcache and apc)
     *
@@ -590,7 +573,6 @@
    {
        return $this->prefix . ':' . $key;
    }
    /**
     * Creates index cache key name (for memcache and apc)
program/lib/Roundcube/rcube_charset.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2012, The Roundcube Dev Team                       |
@@ -77,7 +77,6 @@
    {
        throw new ErrorException($errstr, 0, $errno);
    }
    /**
     * Parse and validate charset name string (see #1485758).
@@ -158,7 +157,6 @@
        return $result;
    }
    /**
     * Convert a string from one charset to another.
@@ -297,13 +295,12 @@
        return $str;
    }
    /**
     * Converts string from standard UTF-7 (RFC 2152) to UTF-8.
     *
     * @param  string  Input string (UTF-7)
     * @param string $str Input string (UTF-7)
     *
     * @return string  Converted string (UTF-8)
     * @return string Converted string (UTF-8)
     */
    public static function utf7_to_utf8($str)
    {
@@ -357,13 +354,12 @@
        return $res;
    }
    /**
     * Converts string from UTF-16 to UTF-8 (helper for utf-7 to utf-8 conversion)
     *
     * @param  string  Input string
     * @param string $str Input string
     *
     * @return string  The converted string
     * @return string The converted string
     */
    public static function utf16_to_utf8($str)
    {
@@ -388,7 +384,6 @@
        return $dec;
    }
    /**
     * Convert the data ($str) from RFC 2060's UTF-7 to UTF-8.
@@ -497,7 +492,6 @@
        return $p;
    }
    /**
     * Convert the data ($str) from UTF-8 to RFC 2060's UTF-7.
@@ -629,7 +623,6 @@
        return $p;
    }
    /**
     * A method to guess character set of a string.
     *
@@ -729,7 +722,6 @@
        return $failover;
    }
    /**
     * Removes non-unicode characters from input.
     *
@@ -817,5 +809,4 @@
        return $out;
    }
}
program/lib/Roundcube/rcube_config.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2008-2014, The Roundcube Dev Team                       |
program/lib/Roundcube/rcube_contacts.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2006-2012, The Roundcube Dev Team                       |
@@ -16,7 +16,6 @@
 +-----------------------------------------------------------------------+
*/
/**
 * Model class for the local address book database
 *
@@ -26,40 +25,40 @@
class rcube_contacts extends rcube_addressbook
{
    // protected for backward compat. with some plugins
    protected $db_name = 'contacts';
    protected $db_groups = 'contactgroups';
    protected $db_name         = 'contacts';
    protected $db_groups       = 'contactgroups';
    protected $db_groupmembers = 'contactgroupmembers';
    protected $vcard_fieldmap = array();
    protected $vcard_fieldmap  = array();
    /**
     * Store database connection.
     *
     * @var rcube_db
     */
    private $db = null;
    private $db      = null;
    private $user_id = 0;
    private $filter = null;
    private $result = null;
    private $filter  = null;
    private $result  = null;
    private $cache;
    private $table_cols = array('name', 'email', 'firstname', 'surname');
    private $table_cols    = array('name', 'email', 'firstname', 'surname');
    private $fulltext_cols = array('name', 'firstname', 'surname', 'middlename', 'nickname',
      'jobtitle', 'organization', 'department', 'maidenname', 'email', 'phone',
      'address', 'street', 'locality', 'zipcode', 'region', 'country', 'website', 'im', 'notes');
        'jobtitle', 'organization', 'department', 'maidenname', 'email', 'phone',
        'address', 'street', 'locality', 'zipcode', 'region', 'country', 'website', 'im', 'notes');
    // public properties
    public $primary_key = 'contact_id';
    public $name;
    public $readonly = false;
    public $groups = true;
    public $undelete = true;
    public $readonly  = false;
    public $groups    = true;
    public $undelete  = true;
    public $list_page = 1;
    public $page_size = 10;
    public $group_id = 0;
    public $ready = false;
    public $coltypes = array('name', 'firstname', 'surname', 'middlename', 'prefix', 'suffix', 'nickname',
      'jobtitle', 'organization', 'department', 'assistant', 'manager',
      'gender', 'maidenname', 'spouse', 'email', 'phone', 'address',
      'birthday', 'anniversary', 'website', 'im', 'notes', 'photo');
    public $group_id  = 0;
    public $ready     = false;
    public $coltypes  = array('name', 'firstname', 'surname', 'middlename', 'prefix', 'suffix', 'nickname',
        'jobtitle', 'organization', 'department', 'assistant', 'manager',
        'gender', 'maidenname', 'spouse', 'email', 'phone', 'address',
        'birthday', 'anniversary', 'website', 'im', 'notes', 'photo');
    public $date_cols = array('birthday', 'anniversary');
    const SEPARATOR = ',';
@@ -68,16 +67,15 @@
    /**
     * Object constructor
     *
     * @param object  Instance of the rcube_db class
     * @param integer User-ID
     * @param object  $dbconn Instance of the rcube_db class
     * @param integer $user User-ID
     */
    function __construct($dbconn, $user)
    {
        $this->db = $dbconn;
        $this->db      = $dbconn;
        $this->user_id = $user;
        $this->ready = $this->db && !$this->db->is_error();
        $this->ready   = $this->db && !$this->db->is_error();
    }
    /**
     * Returns addressbook name
@@ -86,7 +84,6 @@
     {
        return $this->name;
     }
    /**
     * Save a search string for future listings
@@ -99,7 +96,6 @@
        $this->cache = null;
    }
    /**
     * Getter for saved search properties
     *
@@ -110,7 +106,6 @@
        return $this->filter;
    }
    /**
     * Setter for the current group
     * (empty, has to be re-implemented by extending class)
@@ -118,9 +113,8 @@
    function set_group($gid)
    {
        $this->group_id = $gid;
        $this->cache = null;
        $this->cache    = null;
    }
    /**
     * Reset all saved results and search parameters
@@ -129,20 +123,19 @@
    {
        $this->result = null;
        $this->filter = null;
        $this->cache = null;
        $this->cache  = null;
    }
    /**
     * List all active contact groups of this source
     *
     * @param string  Search string to match group name
     * @param int     Matching mode:
     *                0 - partial (*abc*),
     *                1 - strict (=),
     *                2 - prefix (abc*)
     * @param string $search Search string to match group name
     * @param int    $mode   Matching mode:
     *                          0 - partial (*abc*),
     *                          1 - strict (=),
     *                          2 - prefix (abc*)
     *
     * @return array  Indexed list of contact groups, each a hash array
     * @return array Indexed list of contact groups, each a hash array
     */
    function list_groups($search = null, $mode = 0)
    {
@@ -180,11 +173,11 @@
        return $results;
    }
    /**
     * Get group properties such as name and email address(es)
     *
     * @param string Group identifier
     * @param string $group_id Group identifier
     *
     * @return array Group properties as hash array
     */
    function get_group($group_id)
@@ -208,9 +201,10 @@
     * @param  array   List of cols to show, Null means all
     * @param  int     Only return this number of records, use negative values for tail
     * @param  boolean True to skip the count query (select only)
     *
     * @return array  Indexed list of contact records, each a hash array
     */
    function list_records($cols=null, $subset=0, $nocount=false)
    function list_records($cols = null, $subset = 0, $nocount = false)
    {
        if ($nocount || $this->list_page <= 1) {
            // create dummy result, we don't need a count now
@@ -221,13 +215,13 @@
        }
        $start_row = $subset < 0 ? $this->result->first + $this->page_size + $subset : $this->result->first;
        $length = $subset != 0 ? abs($subset) : $this->page_size;
        $length    = $subset != 0 ? abs($subset) : $this->page_size;
        if ($this->group_id)
            $join = " LEFT JOIN " . $this->db->table_name($this->db_groupmembers, true) . " AS m".
                " ON (m.`contact_id` = c.`".$this->primary_key."`)";
        $order_col = (in_array($this->sort_col, $this->table_cols) ? $this->sort_col : 'name');
        $order_col  = (in_array($this->sort_col, $this->table_cols) ? $this->sort_col : 'name');
        $order_cols = array("c.`$order_col`");
        if ($order_col == 'firstname')
            $order_cols[] = 'c.`surname`';
@@ -284,7 +278,6 @@
        return $this->result;
    }
    /**
     * Search contacts
     *
@@ -300,15 +293,16 @@
     *
     * @return object rcube_result_set Contact records and 'count' value
     */
    function search($fields, $value, $mode=0, $select=true, $nocount=false, $required=array())
    function search($fields, $value, $mode = 0, $select = true, $nocount = false, $required = array())
    {
        if (!is_array($required) && !empty($required))
        if (!is_array($required) && !empty($required)) {
            $required = array($required);
        }
        $where = $and_where = $post_search = array();
        $mode = intval($mode);
        $WS = ' ';
        $AS = self::SEPARATOR;
        $mode  = intval($mode);
        $WS    = ' ';
        $AS    = self::SEPARATOR;
        // direct ID search
        if ($fields == 'ID' || $fields == $this->primary_key) {
@@ -500,7 +494,6 @@
        return new rcube_result_set($count, ($this->list_page-1) * $this->page_size);
    }
    /**
     * Count number of available contacts in database
     *
@@ -532,7 +525,6 @@
        return $this->cache['count'];
    }
    /**
     * Return the last result set
     *
@@ -543,18 +535,20 @@
        return $this->result;
    }
    /**
     * Get a specific contact record
     *
     * @param mixed record identifier(s)
     * @param mixed $id    Record identifier(s)
     * @param bool  $assoc Enables returning associative array
     *
     * @return mixed Result object with all record fields or False if not found
     */
    function get_record($id, $assoc=false)
    function get_record($id, $assoc = false)
    {
        // return cached result
        if ($this->result && ($first = $this->result->first()) && $first[$this->primary_key] == $id)
        if ($this->result && ($first = $this->result->first()) && $first[$this->primary_key] == $id) {
            return $assoc ? $first : $this->result;
        }
        $this->db->query(
            "SELECT * FROM " . $this->db->table_name($this->db_name, true).
@@ -574,42 +568,44 @@
        return $assoc && $record ? $record : $this->result;
    }
    /**
     * Get group assignments of a specific contact record
     *
     * @param mixed Record identifier
     * @param mixed $id Record identifier
     *
     * @return array List of assigned groups as ID=>Name pairs
     */
    function get_record_groups($id)
    {
      $results = array();
        $results = array();
      if (!$this->groups)
          return $results;
        if (!$this->groups) {
            return $results;
        }
      $sql_result = $this->db->query(
        "SELECT cgm.`contactgroup_id`, cg.`name` "
        . " FROM " . $this->db->table_name($this->db_groupmembers, true) . " AS cgm"
        . " LEFT JOIN " . $this->db->table_name($this->db_groups, true) . " AS cg"
            . " ON (cgm.`contactgroup_id` = cg.`contactgroup_id` AND cg.`del` <> 1)"
        . " WHERE cgm.`contact_id` = ?",
        $id
      );
      while ($sql_result && ($sql_arr = $this->db->fetch_assoc($sql_result))) {
        $results[$sql_arr['contactgroup_id']] = $sql_arr['name'];
      }
        $sql_result = $this->db->query(
            "SELECT cgm.`contactgroup_id`, cg.`name` "
            . " FROM " . $this->db->table_name($this->db_groupmembers, true) . " AS cgm"
            . " LEFT JOIN " . $this->db->table_name($this->db_groups, true) . " AS cg"
                . " ON (cgm.`contactgroup_id` = cg.`contactgroup_id` AND cg.`del` <> 1)"
            . " WHERE cgm.`contact_id` = ?",
            $id
        );
      return $results;
        while ($sql_result && ($sql_arr = $this->db->fetch_assoc($sql_result))) {
            $results[$sql_arr['contactgroup_id']] = $sql_arr['name'];
        }
        return $results;
    }
    /**
     * Check the given data before saving.
     * If input not valid, the message to display can be fetched using get_error()
     *
     * @param array Assoziative array with data to save
     * @param boolean Try to fix/complete record automatically
     * @param array   $save_data Associative array with data to save
     * @param boolean $autofix   Try to fix/complete record automatically
     *
     * @return boolean True if input is valid, False if not.
     */
    public function validate(&$save_data, $autofix = false)
@@ -626,17 +622,19 @@
        return $valid;
    }
    /**
     * Create a new contact record
     *
     * @param array Associative array with save data
     * @param array $save_data Associative array with save data
     * @param bool  $check     Enables validity checks
     *
     * @return integer|boolean The created record ID on success, False on error
     */
    function insert($save_data, $check=false)
    function insert($save_data, $check = false)
    {
        if (!is_array($save_data))
        if (!is_array($save_data)) {
            return false;
        }
        $insert_id = $existing = false;
@@ -674,12 +672,11 @@
        return $insert_id;
    }
    /**
     * Update a specific contact record
     *
     * @param mixed Record identifier
     * @param array Assoziative array with save data
     * @param mixed $id        Record identifier
     * @param array $save_cols Associative array with save data
     *
     * @return boolean True on success, False on error
     */
@@ -712,7 +709,9 @@
        return $updated ? true : false;
    }
    /**
     * Convert data stored in the database into output format
     */
    private function convert_db_data($sql_arr)
    {
        $record = array();
@@ -732,7 +731,9 @@
        return $record;
    }
    /**
     * Convert input data for storing in the database
     */
    private function convert_save_data($save_data, $record = array())
    {
        $out = array();
@@ -785,17 +786,17 @@
        return $out;
    }
    /**
     * Mark one or more contact records as deleted
     *
     * @param array   Record identifiers
     * @param boolean Remove record(s) irreversible (unsupported)
     * @param array   $ids   Record identifiers
     * @param boolean $force Remove record(s) irreversible (unsupported)
     */
    function delete($ids, $force=true)
    function delete($ids, $force = true)
    {
        if (!is_array($ids))
        if (!is_array($ids)) {
            $ids = explode(self::SEPARATOR, $ids);
        }
        $ids = $this->db->array2list($ids, 'integer');
@@ -813,16 +814,16 @@
        return $this->db->affected_rows();
    }
    /**
     * Undelete one or more contact records
     *
     * @param array  Record identifiers
     * @param array $ids Record identifiers
     */
    function undelete($ids)
    {
        if (!is_array($ids))
        if (!is_array($ids)) {
            $ids = explode(self::SEPARATOR, $ids);
        }
        $ids = $this->db->array2list($ids, 'integer');
@@ -839,7 +840,6 @@
        return $this->db->affected_rows();
    }
    /**
     * Remove all records from the database
@@ -871,11 +871,11 @@
        return $count;
    }
    /**
     * Create a contact group with the given name
     *
     * @param string The group name
     * @param string $name The group name
     *
     * @return mixed False on error, array with record props in success
     */
    function create_group($name)
@@ -898,11 +898,11 @@
        return $result;
    }
    /**
     * Delete the given group (and all linked group members)
     *
     * @param string Group identifier
     * @param string $gid Group identifier
     *
     * @return boolean True on success, false if no data was changed
     */
    function delete_group($gid)
@@ -924,14 +924,16 @@
    /**
     * Rename a specific contact group
     *
     * @param string Group identifier
     * @param string New name to set for this group
     * @param string $gid     Group identifier
     * @param string $name    New name to set for this group
     * @param string $new_gid (not used)
     *
     * @return boolean New name on success, false if no data was changed
     */
    function rename_group($gid, $newname, &$new_gid)
    function rename_group($gid, $name, &$new_gid)
    {
        // make sure we have a unique name
        $name = $this->unique_groupname($newname);
        $name = $this->unique_groupname($name);
        $sql_result = $this->db->query(
            "UPDATE " . $this->db->table_name($this->db_groups, true).
@@ -944,7 +946,6 @@
        return $this->db->affected_rows($sql_result) ? $name : false;
    }
    /**
     * Add the given contact records the a certain group
     *
@@ -955,10 +956,11 @@
     */
    function add_to_group($group_id, $ids)
    {
        if (!is_array($ids))
        if (!is_array($ids)) {
            $ids = explode(self::SEPARATOR, $ids);
        }
        $added = 0;
        $added  = 0;
        $exists = array();
        // get existing assignments ...
@@ -968,9 +970,11 @@
                " AND `contact_id` IN (".$this->db->array2list($ids, 'integer').")",
            $group_id
        );
        while ($sql_result && ($sql_arr = $this->db->fetch_assoc($sql_result))) {
            $exists[] = $sql_arr['contact_id'];
        }
        // ... and remove them from the list
        $ids = array_diff($ids, $exists);
@@ -983,15 +987,16 @@
                $contact_id
            );
            if ($error = $this->db->is_error())
            if ($error = $this->db->is_error()) {
                $this->set_error(self::ERROR_SAVING, $error);
            else
            }
            else {
                $added++;
            }
        }
        return $added;
    }
    /**
     * Remove the given contact records from a certain group
@@ -1018,17 +1023,18 @@
        return $this->db->affected_rows($sql_result);
    }
    /**
     * Check for existing groups with the same name
     *
     * @param string Name to check
     * @param string $name Name to check
     *
     * @return string A group name which is unique for the current use
     */
    private function unique_groupname($name)
    {
        $checkname = $name;
        $num = 2; $hit = false;
        $num       = 2;
        $hit       = false;
        do {
            $sql_result = $this->db->query(
@@ -1043,7 +1049,8 @@
            if ($hit = $this->db->fetch_array($sql_result)) {
                $checkname = $name . ' ' . $num++;
            }
        } while ($hit);
        }
        while ($hit);
        return $checkname;
    }
program/lib/Roundcube/rcube_content_filter.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2011, The Roundcube Dev Team                            |
program/lib/Roundcube/rcube_csv2vcard.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2008-2012, The Roundcube Dev Team                       |
@@ -394,7 +394,9 @@
    }
    /**
     * Import contacts from CSV file
     *
     * @param string $csv Content of the CSV file
     */
    public function import($csv)
    {
@@ -457,6 +459,8 @@
    }
    /**
     * Export vCards
     *
     * @return array rcube_vcard List of vcards
     */
    public function export()
program/lib/Roundcube/rcube_db.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2012, The Roundcube Dev Team                       |
program/lib/Roundcube/rcube_db_mssql.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2012, The Roundcube Dev Team                       |
program/lib/Roundcube/rcube_db_mysql.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2012, The Roundcube Dev Team                       |
program/lib/Roundcube/rcube_db_oracle.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2011-2014, Kolab Systems AG                             |
program/lib/Roundcube/rcube_db_pgsql.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2012, The Roundcube Dev Team                       |
program/lib/Roundcube/rcube_db_sqlite.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2012, The Roundcube Dev Team                       |
program/lib/Roundcube/rcube_db_sqlsrv.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2012, The Roundcube Dev Team                       |
program/lib/Roundcube/rcube_enriched.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2012, The Roundcube Dev Team                       |
@@ -127,6 +127,13 @@
        return $body;
    }
    /**
     * Converts Enriched text into HTML format
     *
     * @param string $body Enriched text
     *
     * @return string HTML text
     */
    public static function to_html($body)
    {
        $body = str_replace('<<','&lt;',$body);
program/lib/Roundcube/rcube_html2text.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2008-2012, The Roundcube Dev Team                       |
program/lib/Roundcube/rcube_image.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2012, The Roundcube Dev Team                       |
@@ -41,6 +41,11 @@
    );
    /**
     * Class constructor
     *
     * @param string $filename Image file name/path
     */
    function __construct($filename)
    {
        $this->image_file = $filename;
program/lib/Roundcube/rcube_imap.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2012, The Roundcube Dev Team                       |
@@ -95,7 +95,6 @@
        }
    }
    /**
     * Magic getter for backward compat.
     *
@@ -107,7 +106,6 @@
            return $this->{$name};
        }
    }
    /**
     * Connect to an IMAP server
@@ -203,7 +201,6 @@
        return false;
    }
    /**
     * Close IMAP connection.
     * Usually done on script shutdown
@@ -215,7 +212,6 @@
            $this->mcache->close();
        }
    }
    /**
     * Check connection state, connect if not connected.
@@ -238,7 +234,6 @@
        return $this->is_connected();
    }
    /**
     * Checks IMAP connection.
     *
@@ -248,7 +243,6 @@
    {
        return $this->conn->connected();
    }
    /**
     * Returns code of last error
@@ -260,7 +254,6 @@
        return $this->conn->errornum;
    }
    /**
     * Returns text of last error
     *
@@ -270,7 +263,6 @@
    {
        return $this->conn->error;
    }
    /**
     * Returns code of last command response
@@ -301,7 +293,6 @@
        }
    }
    /**
     * Activate/deactivate debug mode
     *
@@ -313,23 +304,21 @@
        $this->conn->setDebug($dbg, array($this, 'debug_handler'));
    }
    /**
     * Set internal folder reference.
     * All operations will be perfomed on this folder.
     *
     * @param  string $folder Folder name
     * @param string $folder Folder name
     */
    public function set_folder($folder)
    {
        $this->folder = $folder;
    }
    /**
     * Save a search result for future message listing methods
     *
     * @param  array  $set  Search set, result from rcube_imap::get_search_set():
     * @param array $set Search set, result from rcube_imap::get_search_set():
     *                      0 - searching criteria, string
     *                      1 - search result, rcube_result_index|rcube_result_thread
     *                      2 - searching character set, string
@@ -352,7 +341,6 @@
        }
    }
    /**
     * Return the saved search set as hash array
     *
@@ -372,7 +360,6 @@
            $this->search_sorted,
        );
    }
    /**
     * Returns the IMAP server's capability.
@@ -397,14 +384,13 @@
        return $_SESSION[$sess_key];
    }
    /**
     * Checks the PERMANENTFLAGS capability of the current folder
     * and returns true if the given flag is supported by the IMAP server
     *
     * @param   string  $flag Permanentflag name
     * @param string $flag Permanentflag name
     *
     * @return  boolean True if this flag is supported
     * @return boolean True if this flag is supported
     */
    public function check_permflag($flag)
    {
@@ -415,11 +401,10 @@
        return $imap_flag && !empty($perm_flags) && in_array_nocase($imap_flag, $perm_flags);
    }
    /**
     * Returns PERMANENTFLAGS of the specified folder
     *
     * @param  string $folder Folder name
     * @param string $folder Folder name
     *
     * @return array Flags
     */
@@ -447,25 +432,22 @@
        return $permflags;
    }
    /**
     * Returns the delimiter that is used by the IMAP server for folder separation
     *
     * @return  string  Delimiter string
     * @access  public
     * @return string Delimiter string
     */
    public function get_hierarchy_delimiter()
    {
        return $this->delimiter;
    }
    /**
     * Get namespace
     *
     * @param string $name Namespace array index: personal, other, shared, prefix
     *
     * @return  array  Namespace data
     * @return array Namespace data
     */
    public function get_namespace($name = null)
    {
@@ -478,7 +460,6 @@
        unset($ns['prefix']);
        return $ns;
    }
    /**
     * Sets delimiter and namespaces
@@ -560,7 +541,6 @@
        $_SESSION['imap_delimiter'] = $this->delimiter;
    }
    /**
     * Get message count for a specific folder
     *
@@ -570,7 +550,7 @@
     * @param  boolean $status  Enables storing folder status info (max UID/count),
     *                          required for folder_status()
     *
     * @return int     Number of messages
     * @return int Number of messages
     */
    public function count($folder='', $mode='ALL', $force=false, $status=true)
    {
@@ -580,7 +560,6 @@
        return $this->countmessages($folder, $mode, $force, $status);
    }
    /**
     * protected method for getting nr of messages
@@ -696,7 +675,6 @@
        return (int)$count;
    }
    /**
     * Public method for listing message flags
     *
@@ -731,7 +709,6 @@
        return $result;
    }
    /**
     * Public method for listing headers
     *
@@ -741,7 +718,7 @@
     * @param   string   $sort_order Sort order [ASC|DESC]
     * @param   int      $slice      Number of slice items to extract from result array
     *
     * @return  array    Indexed array with message header objects
     * @return array Indexed array with message header objects
     */
    public function list_messages($folder='', $page=NULL, $sort_field=NULL, $sort_order=NULL, $slice=0)
    {
@@ -752,7 +729,6 @@
        return $this->_list_messages($folder, $page, $sort_field, $sort_order, $slice);
    }
    /**
     * protected method for listing message headers
     *
@@ -762,8 +738,8 @@
     * @param   string   $sort_order Sort order [ASC|DESC]
     * @param   int      $slice      Number of slice items to extract from result array
     *
     * @return  array    Indexed array with message header objects
     * @see     rcube_imap::list_messages
     * @return array Indexed array with message header objects
     * @see rcube_imap::list_messages
     */
    protected function _list_messages($folder='', $page=NULL, $sort_field=NULL, $sort_order=NULL, $slice=0)
    {
@@ -806,16 +782,15 @@
        return array_values($a_msg_headers);
    }
    /**
     * protected method for listing message headers using threads
     *
     * @param   string   $folder     Folder name
     * @param   int      $page       Current page to list
     * @param   int      $slice      Number of slice items to extract from result array
     * @param string $folder Folder name
     * @param int    $page   Current page to list
     * @param int    $slice  Number of slice items to extract from result array
     *
     * @return  array    Indexed array with message header objects
     * @see     rcube_imap::list_messages
     * @return array Indexed array with message header objects
     * @see rcube_imap::list_messages
     */
    protected function list_thread_messages($folder, $page, $slice=0)
    {
@@ -833,7 +808,7 @@
    /**
     * Method for fetching threads data
     *
     * @param  string $folder Folder name
     * @param string $folder Folder name
     *
     * @return rcube_imap_thread Thread data object
     */
@@ -857,11 +832,10 @@
        return $this->icache['threads'] = $result;
    }
    /**
     * Method for direct fetching of threads data
     *
     * @param  string $folder Folder name
     * @param string $folder Folder name
     *
     * @return rcube_imap_thread Thread data object
     */
@@ -876,7 +850,6 @@
            $this->options['skip_deleted'] ? 'UNDELETED' : '', true);
    }
    /**
     * protected method for fetching threaded messages headers
     *
@@ -885,7 +858,7 @@
     * @param int                 $page       List page number
     * @param int                 $slice      Number of threads to slice
     *
     * @return array  Messages headers
     * @return array Messages headers
     */
    protected function fetch_thread_headers($folder, $threads, $page, $slice=0)
    {
@@ -915,13 +888,12 @@
        return array_values($a_msg_headers);
    }
    /**
     * protected method for setting threaded messages flags:
     * depth, has_children and unread_children
     *
     * @param  array               $headers  Reference to headers array indexed by message UID
     * @param  rcube_result_thread $threads  Threads data object
     * @param array               $headers  Reference to headers array indexed by message UID
     * @param rcube_result_thread $threads  Threads data object
     *
     * @return array Message headers array indexed by message UID
     */
@@ -947,7 +919,6 @@
        }
    }
    /**
     * protected method for listing a set of message headers (search results)
     *
@@ -955,7 +926,7 @@
     * @param   int      $page     Current page to list
     * @param   int      $slice    Number of slice items to extract from result array
     *
     * @return  array    Indexed array with message header objects
     * @return array Indexed array with message header objects
     */
    protected function list_search_messages($folder, $page, $slice=0)
    {
@@ -1140,7 +1111,6 @@
        }
    }
    /**
     * protected method for listing a set of threaded message headers (search results)
     *
@@ -1148,7 +1118,7 @@
     * @param   int      $page       Current page to list
     * @param   int      $slice      Number of slice items to extract from result array
     *
     * @return  array    Indexed array with message header objects
     * @return array Indexed array with message header objects
     * @see rcube_imap::list_search_messages()
     */
    protected function list_search_thread_messages($folder, $page, $slice=0)
@@ -1163,7 +1133,6 @@
        return $this->fetch_thread_headers($folder, clone $this->search_set, $page, $slice);
    }
    /**
     * Fetches messages headers (by UID)
@@ -1212,7 +1181,6 @@
        return $a_msg_headers;
    }
    /**
     * Returns current status of a folder (compared to the last time use)
     *
@@ -1260,7 +1228,6 @@
        return $result;
    }
    /**
     * Stores folder statistic data in session
     * @TODO: move to separate DB table (cache?)
@@ -1273,7 +1240,6 @@
    {
        $_SESSION['folders'][$folder][$name] = $data;
    }
    /**
     * Gets folder statistic data
@@ -1290,7 +1256,6 @@
        return array();
    }
    /**
     * Return sorted list of message UIDs
@@ -1369,7 +1334,6 @@
        return $this->index_direct($folder, $this->sort_field, $this->sort_order);
    }
    /**
     * Return sorted list of message UIDs ignoring current search settings.
     * Doesn't uses cache by default.
@@ -1437,7 +1401,6 @@
        return $index;
    }
    /**
     * Return index of threaded message UIDs
     *
@@ -1468,7 +1431,6 @@
        return $threads;
    }
    /**
     * Sort threaded result, using THREAD=REFS method if available.
     * If not, use any method and re-sort the result in THREAD=REFS way.
@@ -1497,7 +1459,6 @@
            $threads->revert();
        }
    }
    /**
     * Invoke search request to IMAP server
@@ -1574,7 +1535,6 @@
        return $results;
    }
    /**
     * Direct (real and simple) SEARCH request (without result sorting and caching).
     *
@@ -1608,7 +1568,6 @@
        return $index;
    }
    /**
     * protected search method
@@ -1686,7 +1645,6 @@
        return $messages;
    }
    /**
     * Converts charset of search criteria string
     *
@@ -1726,7 +1684,6 @@
        return $res;
    }
    /**
     * Refresh saved search set
     *
@@ -1758,7 +1715,6 @@
            }
        }
    }
    /**
     * Return message headers object of a specific message
@@ -1797,7 +1753,6 @@
        return $headers;
    }
    /**
     * Fetch message headers and body structure from the IMAP server and build
@@ -1924,7 +1879,6 @@
        return $this->icache['message'] = $headers;
    }
    /**
     * Build message part object
     *
@@ -1932,7 +1886,7 @@
     * @param int    $count
     * @param string $parent
     */
    protected function structure_part($part, $count=0, $parent='', $mime_headers=null)
    protected function structure_part($part, $count = 0, $parent = '', $mime_headers = null)
    {
        $struct = new rcube_message_part;
        $struct->mime_id = empty($parent) ? (string)$count : "$parent.$count";
@@ -2150,14 +2104,13 @@
        return $struct;
    }
    /**
     * Set attachment filename from message part structure
     *
     * @param  rcube_message_part $part    Part object
     * @param  string             $headers Part's raw headers
     * @param rcube_message_part $part    Part object
     * @param string             $headers Part's raw headers
     */
    protected function set_part_filename(&$part, $headers=null)
    protected function set_part_filename(&$part, $headers = null)
    {
        if (!empty($part->d_parameters['filename'])) {
            $filename_mime = $part->d_parameters['filename'];
@@ -2285,11 +2238,10 @@
        }
    }
    /**
     * Get charset name from message structure (first part)
     *
     * @param  array $structure Message structure
     * @param array $structure Message structure
     *
     * @return string Charset name
     */
@@ -2318,7 +2270,8 @@
     *
     * @return string Message/part body if not printed
     */
    public function get_message_part($uid, $part=1, $o_part=NULL, $print=NULL, $fp=NULL, $skip_charset_conv=false, $max_bytes=0, $formatted=true)
    public function get_message_part($uid, $part = 1, $o_part = null, $print = null, $fp = null,
        $skip_charset_conv = false, $max_bytes = 0, $formatted = true)
    {
        if (!$this->check_connection()) {
            return null;
@@ -2370,7 +2323,6 @@
        return $body;
    }
    /**
     * Returns the whole message source as string (or saves to a file)
     *
@@ -2390,7 +2342,6 @@
            true, $part, null, false, $fp);
    }
    /**
     * Returns the message headers as string
     *
@@ -2408,7 +2359,6 @@
        return $this->conn->fetchPartHeader($this->folder, $uid, true, $part);
    }
    /**
     * Sends the whole message source to stdout
     *
@@ -2423,7 +2373,6 @@
        $this->conn->handlePartBody($this->folder, $uid, true, null, null, true, null, $formatted);
    }
    /**
     * Set message flag to one or several messages
@@ -2484,7 +2433,6 @@
        return $result;
    }
    /**
     * Append a mail message (source) to a specific folder
     *
@@ -2541,7 +2489,6 @@
        return $saved;
    }
    /**
     * Move a message from one folder to another
@@ -2620,7 +2567,6 @@
        return $moved;
    }
    /**
     * Copy a message from one folder to another
     *
@@ -2656,7 +2602,6 @@
        return $copied;
    }
    /**
     * Mark messages as deleted and expunge them
@@ -2714,7 +2659,6 @@
        return $deleted;
    }
    /**
     * Send IMAP expunge command and clear cache
@@ -2838,15 +2782,14 @@
        return $a_mboxes;
    }
    /**
     * Method for direct folders listing (LSUB)
     *
     * @param   string  $root   Optional root folder
     * @param   string  $name   Optional name pattern
     * @param string $root Optional root folder
     * @param string $name Optional name pattern
     *
     * @return  array   List of subscribed folders
     * @see     rcube_imap::list_folders_subscribed()
     * @return array List of subscribed folders
     * @see rcube_imap::list_folders_subscribed()
     */
    public function list_folders_subscribed_direct($root='', $name='*')
    {
@@ -2906,7 +2849,6 @@
        return $a_folders;
    }
    /**
     * Get a list of all folders available on the server
@@ -2976,15 +2918,14 @@
        return $a_mboxes;
    }
    /**
     * Method for direct folders listing (LIST)
     *
     * @param   string  $root   Optional root folder
     * @param   string  $name   Optional name pattern
     * @param string $root Optional root folder
     * @param string $name Optional name pattern
     *
     * @return  array   List of folders
     * @see     rcube_imap::list_folders()
     * @return array List of folders
     * @see rcube_imap::list_folders()
     */
    public function list_folders_direct($root='', $name='*')
    {
@@ -3008,13 +2949,12 @@
        return $result;
    }
    /**
     * Fix folders list by adding folders from other namespaces.
     * Needed on some servers eg. Courier IMAP
     *
     * @param array  $result  Reference to folders list
     * @param string $type    Listing type (ext-subscribed, subscribed or all)
     * @param array  $result Reference to folders list
     * @param string $type   Listing type (ext-subscribed, subscribed or all)
     */
    protected function list_folders_update(&$result, $type = null)
    {
@@ -3064,7 +3004,6 @@
        }
    }
    /**
     * Filter the given list of folders according to access rights
     *
@@ -3090,7 +3029,6 @@
        return $a_folders;
    }
    /**
     * Get mailbox quota information
     *
@@ -3106,7 +3044,6 @@
        return false;
    }
    /**
     * Get folder size (size of all messages in a folder)
@@ -3131,7 +3068,6 @@
        return $result;
    }
    /**
     * Subscribe to a specific folder(s)
     *
@@ -3145,7 +3081,6 @@
        return $this->change_subscription($folders, 'subscribe');
    }
    /**
     * Unsubscribe folder(s)
     *
@@ -3158,7 +3093,6 @@
        // let this common function do the main work
        return $this->change_subscription($folders, 'unsubscribe');
    }
    /**
     * Create a new folder on the server and register it in local cache
@@ -3199,7 +3133,6 @@
        return $result;
    }
    /**
     * Set a new name to an existing folder
@@ -3260,7 +3193,6 @@
        return $result;
    }
    /**
     * Remove folder from server
     *
@@ -3308,7 +3240,6 @@
        return $result;
    }
    /**
     * Detect special folder associations stored in storage backend
     */
@@ -3353,7 +3284,6 @@
        return array_merge($result, $special);
    }
    /**
     * Set special folder associations stored in storage backend
     */
@@ -3391,7 +3321,6 @@
        return true;
    }
    /**
     * Checks if folder exists and is subscribed
@@ -3446,7 +3375,6 @@
        return false;
    }
    /**
     * Returns the namespace where the folder is in
     *
@@ -3476,7 +3404,6 @@
        return 'personal';
    }
    /**
     * Modify folder name according to namespace.
@@ -3516,7 +3443,6 @@
        return $folder;
    }
    /**
     * Gets folder attributes from LIST response, e.g. \Noselect, \Noinferiors
     *
@@ -3548,7 +3474,6 @@
        return is_array($opts) ? $opts : array();
    }
    /**
     * Gets connection (and current folder) data: UIDVALIDITY, EXISTS, RECENT,
@@ -3588,7 +3513,6 @@
        return $data;
    }
    /**
     * Returns extended information about the folder
@@ -3685,7 +3609,6 @@
        return $options;
    }
    /**
     * Synchronizes messages cache.
     *
@@ -3697,7 +3620,6 @@
            $mcache->synchronize($folder);
        }
    }
    /**
     * Get message header names for rcube_imap_generic::fetchHeader(s)
@@ -3750,7 +3672,6 @@
        return $this->conn->setACL($folder, $user, $acl);
    }
    /**
     * Removes any <identifier,rights> pair for the
     * specified user from the ACL for the specified
@@ -3775,7 +3696,6 @@
        return $this->conn->deleteACL($folder, $user);
    }
    /**
     * Returns the access control list for folder (GETACL)
     *
@@ -3796,7 +3716,6 @@
        return $this->conn->getACL($folder);
    }
    /**
     * Returns information about what rights can be granted to the
@@ -3821,7 +3740,6 @@
        return $this->conn->listRights($folder, $user);
    }
    /**
     * Returns the set of rights that the current user has to
     * folder (MYRIGHTS)
@@ -3843,7 +3761,6 @@
        return $this->conn->myRights($folder);
    }
    /**
     * Sets IMAP metadata/annotations (SETMETADATA/SETANNOTATION)
@@ -3878,7 +3795,6 @@
        return false;
    }
    /**
     * Unsets IMAP metadata/annotations (SETMETADATA/SETANNOTATION)
     *
@@ -3911,7 +3827,6 @@
        return false;
    }
    /**
     * Returns IMAP metadata/annotations (GETMETADATA/GETANNOTATION)
@@ -3984,7 +3899,6 @@
        return null;
    }
    /**
     * Converts the METADATA extension entry name into the correct
@@ -4115,7 +4029,6 @@
        }
    }
    /**
     * Getter for messages cache object
     */
@@ -4134,7 +4047,6 @@
        return $this->mcache;
    }
    /**
     * Clears the messages cache.
     *
@@ -4147,7 +4059,6 @@
            $mcache->clear($folder, $uids);
        }
    }
    /**
     * Delete outdated cache entries
@@ -4177,7 +4088,6 @@
            $this->sort_order = strtoupper($sort_order) == 'DESC' ? 'DESC' : 'ASC';
        }
    }
    /**
     * Sort folders first by default folders and then in alphabethical order
@@ -4265,12 +4175,11 @@
        }
    }
    /**
     * Find UID of the specified message sequence ID
     *
     * @param int    $id       Message (sequence) ID
     * @param string $folder   Folder name
     * @param int    $id     Message (sequence) ID
     * @param string $folder Folder name
     *
     * @return int Message UID
     */
@@ -4294,7 +4203,6 @@
        return $uid;
    }
    /**
     * Subscribe/unsubscribe a list of folders and update local cache
@@ -4328,7 +4236,6 @@
        return $updated;
    }
    /**
     * Increde/decrese messagecount for a specific folder
     */
@@ -4359,7 +4266,6 @@
        return true;
    }
    /**
     * Remove messagecount of a specific folder from cache
     */
@@ -4377,7 +4283,6 @@
            $this->update_cache('messagecount', $a_folder_cache);
        }
    }
    /**
     * Converts date string/object into IMAP date/time format
@@ -4400,7 +4305,6 @@
        return $date->format('d-M-Y H:i:s O');
    }
    /**
     * This is our own debug handler for the IMAP connection
@@ -4531,7 +4435,7 @@
        return $this->mod_folder($folder, $mode);
    }
    public function mailbox_attributes($folder, $force=false)
    public function mailbox_attributes($folder, $force = false)
    {
        return $this->folder_attributes($folder, $force);
    }
@@ -4551,9 +4455,8 @@
        return $this->folder_sync($folder);
    }
    public function expunge($folder='', $clear_cache=true)
    public function expunge($folder = '', $clear_cache = true)
    {
        return $this->expunge_folder($folder, $clear_cache);
    }
}
program/lib/Roundcube/rcube_imap_cache.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2012, The Roundcube Dev Team                       |
@@ -99,7 +99,6 @@
    );
    /**
     * Object constructor.
     *
@@ -132,7 +131,6 @@
        $this->messages_table = $db->table_name('cache_messages', true);
    }
    /**
     * Cleanup actions (on shutdown).
     */
@@ -141,7 +139,6 @@
        $this->save_icache();
        $this->icache = null;
    }
    /**
     * Set cache mode
@@ -152,7 +149,6 @@
    {
        $this->mode = $mode;
    }
    /**
     * Return (sorted) messages index (UIDs).
@@ -262,7 +258,6 @@
        return $data;
    }
    /**
     * Return messages thread.
     * If threaded index doesn't exist or is invalid, will be updated.
@@ -317,7 +312,6 @@
        return $index['object'];
    }
    /**
     * Returns list of messages (headers). See rcube_imap::fetch_headers().
@@ -380,7 +374,6 @@
        return $result;
    }
    /**
     * Returns message data.
@@ -448,7 +441,6 @@
        return $message;
    }
    /**
     * Saves the message in cache.
@@ -522,7 +514,6 @@
        $this->db->set_option('ignore_key_errors', false);
    }
    /**
     * Sets the flag for specified message.
     *
@@ -575,7 +566,6 @@
            $this->userid, $mailbox);
    }
    /**
     * Removes message(s) from cache.
     *
@@ -611,7 +601,6 @@
                $this->userid, $mailbox);
        }
    }
    /**
     * Clears index cache.
@@ -652,7 +641,6 @@
        }
    }
    /**
     * Clears thread cache.
     *
@@ -677,7 +665,6 @@
        }
    }
    /**
     * Clears the cache.
     *
@@ -690,7 +677,6 @@
        $this->remove_thread($mailbox);
        $this->remove_message($mailbox, $uids);
    }
    /**
     * Delete expired cache entries
@@ -710,7 +696,6 @@
        $db->query("DELETE FROM ".$db->table_name('cache_thread', true)
              ." WHERE `expires` < $now");
    }
    /**
     * Fetches index data from database
@@ -748,7 +733,6 @@
        return null;
    }
    /**
     * Fetches thread data from database
     */
@@ -781,7 +765,6 @@
        return null;
    }
    /**
     * Saves index data into database
@@ -836,7 +819,6 @@
        $this->db->set_option('ignore_key_errors', false);
    }
    /**
     * Saves thread data into database
     */
@@ -886,7 +868,6 @@
        $this->db->set_option('ignore_key_errors', false);
    }
    /**
     * Checks index/thread validity
@@ -1012,7 +993,6 @@
        return true;
    }
    /**
     * Synchronizes the mailbox.
@@ -1190,7 +1170,6 @@
        $this->icache[$mailbox]['index']['object'] = $data;
    }
    /**
     * Converts cache row into message object.
     *
@@ -1214,7 +1193,6 @@
        return $message;
    }
    /**
     * Saves message stored in internal cache
     */
@@ -1235,7 +1213,6 @@
            $this->icache['__message']['md5sum'] = $md5sum;
        }
    }
    /**
     * Prepares message object to be stored in database.
@@ -1276,7 +1253,6 @@
        }
    }
    /**
     * Fetches index data from IMAP server
     */
@@ -1297,7 +1273,6 @@
        return $index;
    }
    /**
     * Fetches thread data from IMAP server
     */
@@ -1314,7 +1289,6 @@
        return new rcube_result_thread($mailbox, '* THREAD');
    }
}
// for backward compat.
program/lib/Roundcube/rcube_imap_generic.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2012, The Roundcube Dev Team                       |
program/lib/Roundcube/rcube_imap_search.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 |                                                                       |
program/lib/Roundcube/rcube_ldap.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2006-2013, The Roundcube Dev Team                       |
@@ -239,10 +239,9 @@
        $this->_connect();
    }
    /**
    * Establish a connection to the LDAP server
    */
     * Establish a connection to the LDAP server
     */
    private function _connect()
    {
        $rcube = rcube::get_instance();
@@ -439,7 +438,6 @@
        return $this->ready;
    }
    /**
     * Close connection to LDAP server
     */
@@ -450,7 +448,6 @@
        }
    }
    /**
     * Returns address book name
     *
@@ -460,7 +457,6 @@
    {
        return $this->prop['name'];
    }
    /**
     * Set internal list page
@@ -484,7 +480,6 @@
        $this->ldap->set_vlv_page($this->list_page, $this->page_size);
    }
    /**
     * Set internal sort settings
     *
@@ -497,7 +492,6 @@
            $this->sort_col = $this->coltypes[$sort_col]['attributes'][0];
    }
    /**
     * Save a search string for future listings
     *
@@ -507,7 +501,6 @@
    {
        $this->filter = $filter;
    }
    /**
     * Getter for saved search properties
@@ -519,7 +512,6 @@
        return $this->filter;
    }
    /**
     * Reset all saved results and search parameters
     */
@@ -530,14 +522,13 @@
        $this->filter = '';
    }
    /**
     * List the current set of contact records
     *
     * @param  array  List of cols to show
     * @param  int    Only return this number of records
     * @param array List of cols to show
     * @param int   Only return this number of records
     *
     * @return array  Indexed list of contact records, each a hash array
     * @return array Indexed list of contact records, each a hash array
     */
    function list_records($cols=null, $subset=0)
    {
@@ -736,7 +727,6 @@
        return strcmp($a[$this->sort_col][0], $b[$this->sort_col][0]);
    }
    /**
     * Search contacts
     *
@@ -892,7 +882,6 @@
        return $this->result;
    }
    /**
     * Count number of available contacts in database
     *
@@ -920,7 +909,6 @@
        return new rcube_result_set($count, ($this->list_page-1) * $this->page_size);
    }
    /**
     * Return the last result set
@@ -989,7 +977,6 @@
        return $err;
    }
    /**
     * Check the given data before saving.
@@ -1062,7 +1049,6 @@
        return true;
    }
    /**
     * Create a new contact record
     *
@@ -1131,7 +1117,6 @@
        return $dn;
    }
    /**
     * Update a specific contact record
@@ -1314,7 +1299,6 @@
        return $newdn ? $newdn : true;
    }
    /**
     * Mark one or more contact records as deleted
     *
@@ -1363,7 +1347,6 @@
        return count($ids);
    }
    /**
     * Remove all contact records
@@ -1433,7 +1416,6 @@
        }
    }
    /**
     * Converts LDAP entry into an array
     */
@@ -1492,7 +1474,6 @@
        return $out;
    }
    /**
     * Return LDAP attribute(s) for the given field
     */
@@ -1500,7 +1481,6 @@
    {
        return (array)$this->coltypes[$field]['attributes'];
    }
    /**
     * Convert a record data set into LDAP field attributes
@@ -2043,7 +2023,6 @@
        return $default;
    }
    /**
     * HTML-safe DN string encoding
     *
@@ -2070,5 +2049,4 @@
        $str = str_pad(strtr($str, '-_', '+/'), strlen($str) % 4, '=', STR_PAD_RIGHT);
        return base64_decode($str);
    }
}
program/lib/Roundcube/rcube_ldap_generic.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | Roundcube/rcube_ldap_generic.php                                      |
 |                                                                       |
program/lib/Roundcube/rcube_message.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2008-2014, The Roundcube Dev Team                       |
@@ -123,7 +123,6 @@
        $this->app->plugins->exec_hook('message_load', array('object' => $this));
    }
    /**
     * Return a (decoded) message header
     *
@@ -140,7 +139,6 @@
        return $this->headers->get($name, !$raw);
    }
    /**
     * Set is_safe var and session data
     *
@@ -150,7 +148,6 @@
    {
        $_SESSION['safe_messages'][$this->folder.':'.$this->uid] = $this->is_safe = $safe;
    }
    /**
     * Compose a valid URL for getting a message part
@@ -166,7 +163,6 @@
        else
            return false;
    }
    /**
     * Get content of a specific part of this message
@@ -198,7 +194,6 @@
                NULL, $fp, $skip_charset_conv, $max_bytes, $formatted);
        }
    }
    /**
     * Get content of a specific part of this message
@@ -283,7 +278,6 @@
        return $body;
    }
    /**
     * Format text message part for display
     *
@@ -323,7 +317,6 @@
        return $body;
    }
    /**
     * Determine if the message contains a HTML part. This must to be
@@ -370,7 +363,6 @@
        return false;
    }
    /**
     * Determine if the message contains a text/plain part. This must to be
     * a real part not an attachment (or its part)
@@ -410,7 +402,6 @@
        return false;
    }
    /**
     * Return the first HTML part of this message
     *
@@ -425,7 +416,6 @@
            }
        }
    }
    /**
     * Return the first text part of this message
@@ -457,7 +447,6 @@
        return null;
    }
    /**
     * Checks if part of the message is an attachment (or part of it)
     *
@@ -482,7 +471,6 @@
        return false;
    }
    /**
     * Read the message structure returend by the IMAP server
@@ -860,7 +848,6 @@
        }
    }
    /**
     * Fill aflat array with references to all parts, indexed by part numbers
     *
@@ -875,7 +862,6 @@
            for ($i=0; $i<count($part->parts); $i++)
                $this->get_mime_numbers($part->parts[$i]);
    }
    /**
     * Decode a Microsoft Outlook TNEF part (winmail.dat)
@@ -911,7 +897,6 @@
        return $parts;
    }
    /**
     * Parse message body for UUencoded attachments bodies
program/lib/Roundcube/rcube_message_header.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2012, The Roundcube Dev Team                       |
program/lib/Roundcube/rcube_message_part.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2012, The Roundcube Dev Team                       |
@@ -56,11 +56,6 @@
     */
    public $mimetype = 'text/plain';
    public $disposition = '';
    public $filename = '';
    public $encoding = '8bit';
    public $charset = '';
    /**
     * Part size in bytes
     *
@@ -75,6 +70,10 @@
     */
    public $headers = array();
    public $disposition  = '';
    public $filename     = '';
    public $encoding     = '8bit';
    public $charset      = '';
    public $d_parameters = array();
    public $ctype_parameters = array();
@@ -92,5 +91,4 @@
            }
        }
    }
}
program/lib/Roundcube/rcube_mime.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2014, The Roundcube Dev Team                       |
program/lib/Roundcube/rcube_output.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube PHP suite                          |
 | Copyright (C) 2005-2014 The Roundcube Dev Team                        |
program/lib/Roundcube/rcube_plugin.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2008-2014, The Roundcube Dev Team                       |
program/lib/Roundcube/rcube_plugin_api.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2008-2012, The Roundcube Dev Team                       |
program/lib/Roundcube/rcube_result_index.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2011, The Roundcube Dev Team                       |
@@ -45,7 +45,6 @@
        $this->mailbox = $mailbox;
        $this->init($data);
    }
    /**
     * Initializes object with SORT command response
@@ -127,7 +126,6 @@
        $this->raw_data = $data;
    }
    /**
     * Checks the result from IMAP command
     *
@@ -138,7 +136,6 @@
        return $this->raw_data === null ? true : false;
    }
    /**
     * Checks if the result is empty
     *
@@ -148,7 +145,6 @@
    {
        return empty($this->raw_data) ? true : false;
    }
    /**
     * Returns number of elements in the result
@@ -171,7 +167,6 @@
        return $this->meta['count'];
    }
    /**
     * Returns number of elements in the result.
     * Alias for count() for compatibility with rcube_result_thread
@@ -182,7 +177,6 @@
    {
        return $this->count();
    }
    /**
     * Returns maximal message identifier in the result
@@ -198,7 +192,6 @@
        return $this->meta['max'];
    }
    /**
     * Returns minimal message identifier in the result
     *
@@ -213,13 +206,11 @@
        return $this->meta['min'];
    }
    /**
     * Slices data set.
     *
     * @param $offset Offset (as for PHP's array_slice())
     * @param $length Number of elements (as for PHP's array_slice())
     *
     */
    public function slice($offset, $length)
    {
@@ -230,7 +221,6 @@
        $this->meta['count'] = count($data);
        $this->raw_data      = implode(self::SEPARATOR_ELEMENT, $data);
    }
    /**
     * Filters data set. Removes elements not listed in $ids list.
@@ -246,7 +236,6 @@
        $this->meta['count'] = count($data);
        $this->raw_data      = implode(self::SEPARATOR_ELEMENT, $data);
    }
    /**
     * Reverts order of elements in the result
@@ -266,7 +255,6 @@
        $this->meta['pos'] = array();
    }
    /**
     * Check if the given message ID exists in the object
@@ -307,7 +295,6 @@
        return false;
    }
    /**
     * Return all messages in the result.
     *
@@ -322,7 +309,6 @@
        return explode(self::SEPARATOR_ELEMENT, $this->raw_data);
    }
    /**
     * Return all messages in the result.
     *
@@ -336,7 +322,6 @@
        return rcube_imap_generic::compressMessageSet($this->get());
    }
    /**
     * Return result element at specified index
@@ -397,7 +382,6 @@
        return $data[$index];
    }
    /**
     * Returns response parameters, e.g. ESEARCH's MIN/MAX/COUNT/ALL/MODSEQ
     * or internal data e.g. MAILBOX, ORDER
@@ -418,7 +402,6 @@
        return $params;
    }
    /**
     * Returns length of internal data representation
program/lib/Roundcube/rcube_result_multifolder.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2011, The Roundcube Dev Team                       |
@@ -46,7 +46,6 @@
        $this->folders = $folders;
        $this->meta    = array('count' => 0);
    }
    /**
     * Initializes object with SORT command response
@@ -103,7 +102,6 @@
        return false;
    }
    /**
     * Checks if the result is empty
     *
@@ -113,7 +111,6 @@
    {
        return empty($this->sets) || $this->meta['count'] == 0;
    }
    /**
     * Returns number of elements in the result
@@ -125,7 +122,6 @@
        return $this->meta['count'];
    }
    /**
     * Returns number of elements in the result.
     * Alias for count() for compatibility with rcube_result_thread
@@ -136,7 +132,6 @@
    {
        return $this->count();
    }
    /**
     * Reverts order of elements in the result
@@ -159,7 +154,6 @@
        }
    }
    /**
     * Check if the given message ID exists in the object
     *
@@ -177,7 +171,6 @@
        return array_search($msgid, $this->index);
    }
    /**
     * Filters data set. Removes elements listed in $ids list.
@@ -232,7 +225,6 @@
        return $this->index;
    }
    /**
     * Return all messages in the result.
     *
@@ -242,7 +234,6 @@
    {
        return '';
    }
    /**
     * Return result element at specified index
@@ -259,7 +250,6 @@
            default:      return $this->index[$idx];
        }
    }
    /**
     * Returns response parameters, e.g. ESEARCH's MIN/MAX/COUNT/ALL/MODSEQ
@@ -333,5 +323,4 @@
            }
        }
    }
}
program/lib/Roundcube/rcube_result_set.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2006-2013, The Roundcube Dev Team                       |
@@ -115,5 +115,4 @@
    {
        return isset($this->records[$this->current]);
    }
}
program/lib/Roundcube/rcube_result_thread.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2011, The Roundcube Dev Team                       |
@@ -47,7 +47,6 @@
        $this->init($data);
    }
    /**
     * Initializes object with IMAP command response
     *
@@ -83,7 +82,6 @@
        $this->raw_data = $this->parse_thread($data);
    }
    /**
     * Checks the result from IMAP command
     *
@@ -94,7 +92,6 @@
        return $this->raw_data === null ? true : false;
    }
    /**
     * Checks if the result is empty
     *
@@ -104,7 +101,6 @@
    {
        return empty($this->raw_data) ? true : false;
    }
    /**
     * Returns number of elements (threads) in the result
@@ -128,7 +124,6 @@
        return $this->meta['count'];
    }
    /**
     * Returns number of all messages in the result
@@ -155,7 +150,6 @@
        return $this->meta['messages'];
    }
    /**
     * Returns maximum message identifier in the result
     *
@@ -169,7 +163,6 @@
        return $this->meta['max'];
    }
    /**
     * Returns minimum message identifier in the result
     *
@@ -182,7 +175,6 @@
        }
        return $this->meta['min'];
    }
    /**
     * Slices data set.
@@ -199,7 +191,6 @@
        $this->meta['count'] = count($data);
        $this->raw_data      = implode(self::SEPARATOR_ELEMENT, $data);
    }
    /**
     * Filters data set. Removes threads not listed in $roots list.
@@ -240,7 +231,6 @@
        $this->raw_data = ltrim($result, self::SEPARATOR_ELEMENT);
    }
    /**
     * Reverts order of elements in the result
     */
@@ -269,7 +259,6 @@
        $this->raw_data = rtrim($result, self::SEPARATOR_ELEMENT);
    }
    /**
     * Check if the given message ID exists in the object
@@ -314,7 +303,6 @@
        return false;
    }
    /**
     * Return IDs of all messages in the result. Threaded data will be flattened.
     *
@@ -333,7 +321,6 @@
        return preg_split($regexp, $this->raw_data);
    }
    /**
     * Return all messages in the result.
     *
@@ -347,7 +334,6 @@
        return rcube_imap_generic::compressMessageSet($this->get());
    }
    /**
     * Return result element at specified index (all messages, not roots)
@@ -418,11 +404,10 @@
        return $data[$index];
    }
    /**
     * Returns response parameters e.g. MAILBOX, ORDER
     *
     * @param string $param  Parameter name
     * @param string $param Parameter name
     *
     * @return array|string Response parameters or parameter value
     */
@@ -438,7 +423,6 @@
        return $params;
    }
    /**
     * THREAD=REFS sorting implementation (based on provided index)
@@ -509,7 +493,6 @@
        $this->raw_data = implode(self::SEPARATOR_ELEMENT, $result);
    }
    /**
     * Returns data as tree
     *
@@ -534,7 +517,6 @@
        return $result;
    }
    /**
     * Returns thread depth and children data
     *
@@ -551,7 +533,6 @@
        return array($depth, $children);
    }
    /**
     * Creates 'depth' and 'children' arrays from stored thread 'tree' data.
     */
@@ -566,7 +547,6 @@
            }
        }
    }
    /**
     * Converts part of the raw thread into an array
@@ -589,7 +569,6 @@
        return $result;
    }
    /**
     * IMAP THREAD response parser
program/lib/Roundcube/rcube_session.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2014, The Roundcube Dev Team                       |
@@ -15,7 +15,7 @@
 +-----------------------------------------------------------------------+
 | Author: Thomas Bruederli <roundcube@gmail.com>                        |
 | Author: Aleksander Machniak <alec@alec.pl>                            |
 | Author: Cor Bosman <cor@roundcu.be>                            |
 | Author: Cor Bosman <cor@roundcu.be>                                   |
 +-----------------------------------------------------------------------+
*/
@@ -29,22 +29,22 @@
 */
abstract class rcube_session
{
    protected $config;
    protected $key;
    protected $ip;
    protected $changed;
    protected $start;
    protected $time_diff = 0;
    protected $reloaded = false;
    protected $appends = array();
    protected $unsets = array();
    protected $gc_handlers = array();
    protected $cookiename = 'roundcube_sessauth';
    protected $vars;
    protected $now;
    protected $secret = '';
    protected $ip_check = false;
    protected $logging = false;
    protected $config;
    protected $time_diff    = 0;
    protected $reloaded     = false;
    protected $appends      = array();
    protected $unsets       = array();
    protected $gc_handlers  = array();
    protected $cookiename   = 'roundcube_sessauth';
    protected $secret       = '';
    protected $ip_check     = false;
    protected $logging      = false;
    /**
     * Blocks session data from being written to database.
@@ -116,7 +116,6 @@
        );
    }
    /**
     * Wrapper for session_start()
     */
@@ -142,12 +141,12 @@
    abstract function write($key, $vars);
    abstract function update($key, $newvars, $oldvars);
    /**
     * session write handler. This calls the implementation methods for write/update after some initial checks.
     *
     * @param $key
     * @param $vars
     *
     * @return bool
     */
    public function sess_write($key, $vars)
@@ -168,7 +167,6 @@
            return $this->write($key, $vars);
        }
    }
    /**
     * Wrapper for session_write_close()
@@ -242,7 +240,6 @@
        $this->gc_handlers[] = $func;
    }
    /**
     * Garbage collector handler to run on script shutdown
     */
@@ -254,7 +251,6 @@
            }
        }
    }
    /**
     * Generate and set new session id
@@ -294,7 +290,6 @@
        return $cache;
    }
    /**
     * Append the given value to the certain node in the session data array
     *
@@ -328,7 +323,6 @@
            unset($this->unsets[$path]);
    }
    /**
     * Unset a session variable
     *
@@ -356,18 +350,16 @@
        return true;
    }
    /**
     * Kill this session
     */
    public function kill()
    {
        $this->vars = null;
        $this->ip = rcube_utils::remote_addr(); // update IP (might have changed)
        $this->ip   = rcube_utils::remote_addr(); // update IP (might have changed)
        $this->destroy(session_id());
        rcube_utils::setcookie($this->cookiename, '-del-', time() - 60);
    }
    /**
     * Re-read session data from storage backend
@@ -443,7 +435,6 @@
        return $data;
    }
    /**
     * Unserialize session data
@@ -543,7 +534,6 @@
        return unserialize( 'a:' . $items . ':{' . $serialized . '}' );
    }
    /**
     * Setter for session lifetime
     */
@@ -556,7 +546,6 @@
        $this->now = $now - ($now % ($this->lifetime / 2));
    }
    /**
     * Getter for remote IP saved with this session
     */
@@ -564,7 +553,6 @@
    {
        return $this->ip;
    }
    /**
     * Setter for cookie encryption secret
@@ -574,7 +562,6 @@
        $this->secret = $secret;
    }
    /**
     * Enable/disable IP check
     */
@@ -582,7 +569,6 @@
    {
        $this->ip_check = $check;
    }
    /**
     * Setter for the cookie name used for session cookie
@@ -593,7 +579,6 @@
            $this->cookiename = $cookiename;
        }
    }
    /**
     * Check session authentication cookie
@@ -632,7 +617,6 @@
        return $result;
    }
    /**
     * Set session authentication cookie
     */
@@ -642,7 +626,6 @@
        rcube_utils::setcookie($this->cookiename, $this->cookie, 0);
        $_COOKIE[$this->cookiename] = $this->cookie;
    }
    /**
     * Create session cookie from session data
program/lib/Roundcube/rcube_session_db.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2014, The Roundcube Dev Team                       |
@@ -71,7 +71,6 @@
        return true;
    }
    /**
     * Handler for session_destroy()
     *
@@ -109,7 +108,6 @@
            return !empty($this->vars) ? (string) $this->vars : '';
        }
        return null;
    }
    /**
@@ -121,16 +119,15 @@
     */
    public function write($key, $vars)
    {
        $now        = $this->db->now();
        $now = $this->db->now();
        $this->db->query("INSERT INTO {$this->table_name}"
                         . " (`sess_id`, `vars`, `ip`, `created`, `changed`)"
                         . " VALUES (?, ?, ?, $now, $now)",
                         $key, base64_encode($vars), (string)$this->ip);
            . " (`sess_id`, `vars`, `ip`, `created`, `changed`)"
            . " VALUES (?, ?, ?, $now, $now)",
            $key, base64_encode($vars), (string)$this->ip);
        return true;
    }
    /**
     * update session data
@@ -150,12 +147,12 @@
        // else update expire timestamp only when certain conditions are met
        if ($newvars !== $oldvars) {
            $this->db->query("UPDATE {$this->table_name} "
                             . "SET `changed` = $now, `vars` = ? WHERE `sess_id` = ?",
                             base64_encode($newvars), $key);
                . "SET `changed` = $now, `vars` = ? WHERE `sess_id` = ?",
                base64_encode($newvars), $key);
        }
        else if ($ts - $this->changed + $this->time_diff > $this->lifetime / 2) {
            $this->db->query("UPDATE {$this->table_name} SET `changed` = $now"
                                 . " WHERE `sess_id` = ?", $key);
                . " WHERE `sess_id` = ?", $key);
        }
        return true;
@@ -168,8 +165,10 @@
    {
        // just clean all old sessions when this GC is called
        $this->db->query("DELETE FROM " . $this->db->table_name('session')
                         . " WHERE changed < " . $this->db->now(-$this->gc_enabled));
        $this->log("Session GC (DB): remove records < " . date('Y-m-d H:i:s', time() - $this->gc_enabled) . '; rows = ' . intval($this->db->affected_rows()));
    }
            . " WHERE changed < " . $this->db->now(-$this->gc_enabled));
}
        $this->log("Session GC (DB): remove records < "
            . date('Y-m-d H:i:s', time() - $this->gc_enabled)
            . '; rows = ' . intval($this->db->affected_rows()));
    }
}
program/lib/Roundcube/rcube_session_memcache.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2014, The Roundcube Dev Team                       |
@@ -92,7 +92,6 @@
        return true;
    }
    /**
     * Read session data from memcache
program/lib/Roundcube/rcube_session_php.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2014, The Roundcube Dev Team                       |
@@ -73,5 +73,4 @@
        $this->changed = $_SESSION['__MTIME'];
    }
}
}
program/lib/Roundcube/rcube_session_redis.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2014, The Roundcube Dev Team                       |
@@ -10,7 +10,7 @@
 | See the README file for a full license statement.                     |
 |                                                                       |
 | PURPOSE:                                                              |
 |   Provide redis supported session management                       |
 |   Provide redis supported session management                          |
 +-----------------------------------------------------------------------+
 | Author: Cor Bosman <cor@roundcu.be>                                   |
 +-----------------------------------------------------------------------+
@@ -152,7 +152,6 @@
        return true;
    }
    /**
     * read data from redis store
     *
@@ -170,10 +169,7 @@
            return !empty($this->vars) ? (string) $this->vars : '';
        }
        return null;
    }
    /**
     * write data to redis store
@@ -188,12 +184,12 @@
        $ts = microtime(true);
        if ($newvars !== $oldvars || $ts - $this->changed > $this->lifetime / 3) {
            $this->redis->setex($key, $this->lifetime + 60, serialize(array('changed' => time(), 'ip' => $this->ip, 'vars' => $newvars)));
            $data = serialize(array('changed' => time(), 'ip' => $this->ip, 'vars' => $newvars));
            $this->redis->setex($key, $this->lifetime + 60, $data);
        }
        return true;
    }
    /**
     * write data to redis store
@@ -204,8 +200,8 @@
     */
    public function write($key, $vars)
    {
        return $this->redis->setex($key, $this->lifetime + 60, serialize(array('changed' => time(), 'ip' => $this->ip, 'vars' => $vars)));
        $data = serialize(array('changed' => time(), 'ip' => $this->ip, 'vars' => $vars));
        return $this->redis->setex($key, $this->lifetime + 60, $data);
    }
}
}
program/lib/Roundcube/rcube_smtp.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2012, The Roundcube Dev Team                       |
@@ -26,7 +26,7 @@
 */
class rcube_smtp
{
    private $conn = null;
    private $conn;
    private $response;
    private $error;
    private $anonymize_log = 0;
@@ -330,7 +330,6 @@
            $this->conn = null;
        }
    }
    /**
     * This is our own debug handler for the SMTP connection
program/lib/Roundcube/rcube_spellcheck_atd.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 |                                                                       |
@@ -199,6 +199,4 @@
        return $result;
    }
}
program/lib/Roundcube/rcube_spellcheck_enchant.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 |                                                                       |
@@ -177,6 +177,4 @@
        return $result;
    }
}
program/lib/Roundcube/rcube_spellcheck_engine.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 |                                                                       |
@@ -86,6 +86,4 @@
    {
        return $this->error;
    }
}
program/lib/Roundcube/rcube_spellcheck_googie.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 |                                                                       |
@@ -175,6 +175,4 @@
        return $result;
    }
}
program/lib/Roundcube/rcube_spellcheck_pspell.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 |                                                                       |
@@ -184,6 +184,4 @@
        return $result;
    }
}
program/lib/Roundcube/rcube_spellchecker.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2011-2013, Kolab Systems AG                             |
@@ -137,7 +137,6 @@
        return $this->found() == 0;
    }
    /**
     * Number of mispellings found (after check)
     *
@@ -147,7 +146,6 @@
    {
        return count($this->matches);
    }
    /**
     * Returns suggestions for the specified word
@@ -164,7 +162,6 @@
        return array();
    }
    /**
     * Returns misspelled words
@@ -187,7 +184,6 @@
        return array();
    }
    /**
     * Returns checking result in XML (Googiespell) format
     *
@@ -208,7 +204,6 @@
        return $out;
    }
    /**
     * Returns checking result (misspelled words with suggestions)
@@ -243,7 +238,6 @@
        return $result;
    }
    /**
     * Returns error message
     *
@@ -254,13 +248,11 @@
        return $this->error ? $this->error : ($this->backend ? $this->backend->error() : false);
    }
    private function html2text($text)
    {
        $h2t = new rcube_html2text($text, false, true, 0);
        return $h2t->get_text();
    }
    /**
     * Check if the specified word is an exception accoring to 
@@ -300,7 +292,6 @@
        return false;
    }
    /**
     * Add a word to dictionary
     *
@@ -324,7 +315,6 @@
        }
    }
    /**
     * Remove a word from dictionary
     *
@@ -339,7 +329,6 @@
            $this->update_dict();
        }
    }
    /**
     * Update dictionary row in DB
@@ -382,7 +371,6 @@
                $plugin['userid'], $plugin['language'], implode(' ', $plugin['dictionary']));
        }
    }
    /**
     * Get dictionary from DB
program/lib/Roundcube/rcube_storage.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2012, The Roundcube Dev Team                       |
@@ -93,12 +93,10 @@
     */
    abstract function connect($host, $user, $pass, $port = 143, $use_ssl = null);
    /**
     * Close connection. Usually done on script shutdown
     */
    abstract function close();
    /**
     * Checks connection state.
@@ -107,14 +105,12 @@
     */
    abstract function is_connected();
    /**
     * Check connection state, connect if not connected.
     *
     * @return bool Connection state.
     */
    abstract function check_connection();
    /**
     * Returns code of last error
@@ -123,7 +119,6 @@
     */
    abstract function get_error_code();
    /**
     * Returns message of last error
     *
@@ -131,14 +126,12 @@
     */
    abstract function get_error_str();
    /**
     * Returns code of last command response
     *
     * @return int Response code (class constant)
     */
    abstract function get_response_code();
    /**
     * Set connection and class options
@@ -149,7 +142,6 @@
    {
        $this->options = array_merge($this->options, (array)$opt);
    }
    /**
     * Get connection/class option
@@ -163,14 +155,12 @@
        return $this->options[$name];
    }
    /**
     * Activate/deactivate debug mode.
     *
     * @param boolean $dbg True if conversation with the server should be logged
     */
    abstract function set_debug($dbg = true);
    /**
     * Set default message charset.
@@ -183,7 +173,6 @@
    {
        $this->default_charset = $cs;
    }
    /**
     * Set internal folder reference.
@@ -200,7 +189,6 @@
        $this->folder = $folder;
    }
    /**
     * Returns the currently used folder name
     *
@@ -210,7 +198,6 @@
    {
        return $this->folder;
    }
    /**
     * Set internal list page number.
@@ -222,7 +209,6 @@
        $this->list_page = (int) $page;
    }
    /**
     * Gets internal list page number.
     *
@@ -232,7 +218,6 @@
    {
        return $this->list_page;
    }
    /**
     * Set internal page size
@@ -244,7 +229,6 @@
        $this->page_size = (int) $size;
    }
    /**
     * Get internal page size
     *
@@ -255,7 +239,6 @@
        return $this->page_size;
    }
    /**
     * Save a search result for future message listing methods.
     *
@@ -263,14 +246,12 @@
     */
    abstract function set_search_set($set);
    /**
     * Return the saved search set.
     *
     * @return array Search set in driver specific format, NULL if search wasn't initialized
     */
    abstract function get_search_set();
    /**
     * Returns the storage server's (IMAP) capability
@@ -280,7 +261,6 @@
     * @return  mixed   Capability value or TRUE if supported, FALSE if not
     */
    abstract function get_capability($cap);
    /**
     * Sets threading flag to the best supported THREAD algorithm.
@@ -304,7 +284,6 @@
        return $this->threading;
    }
    /**
     * Get current threading flag.
     *
@@ -314,7 +293,6 @@
    {
        return $this->threading;
    }
    /**
     * Checks the PERMANENTFLAGS capability of the current folder
@@ -326,7 +304,6 @@
     */
    abstract function check_permflag($flag);
    /**
     * Returns the delimiter that is used by the server
     * for folder hierarchy separation.
@@ -334,7 +311,6 @@
     * @return  string  Delimiter string
     */
    abstract function get_hierarchy_delimiter();
    /**
     * Get namespace
@@ -344,7 +320,6 @@
     * @return  array  Namespace data
     */
    abstract function get_namespace($name = null);
    /**
     * Get messages count for a specific folder.
@@ -359,7 +334,6 @@
     */
    abstract function count($folder = null, $mode = 'ALL', $force = false, $status = true);
    /**
     * Public method for listing message flags
     *
@@ -370,7 +344,6 @@
     * @return array Indexed array with message flags
     */
    abstract function list_flags($folder, $uids, $mod_seq = null);
    /**
     * Public method for listing headers.
@@ -385,7 +358,6 @@
     */
    abstract function list_messages($folder = null, $page = null, $sort_field = null, $sort_order = null, $slice = 0);
    /**
     * Return sorted list of message UIDs
     *
@@ -396,7 +368,6 @@
     * @return rcube_result_index|rcube_result_thread List of messages (UIDs)
     */
    abstract function index($folder = null, $sort_field = null, $sort_order = null);
    /**
     * Invoke search request to the server.
@@ -410,7 +381,6 @@
     */
    abstract function search($folder = null, $str = 'ALL', $charset = null, $sort_field = null);
    /**
     * Direct (real and simple) search request (without result sorting and caching).
     *
@@ -420,7 +390,6 @@
     * @return rcube_result_index  Search result (UIDs)
     */
    abstract function search_once($folder = null, $str = 'ALL');
    /**
     * Refresh saved search set
@@ -445,7 +414,6 @@
     */
    abstract function get_message($uid, $folder = null);
    /**
     * Return message headers object of a specific message
     *
@@ -456,7 +424,6 @@
     * @return rcube_message_header Message headers
     */
    abstract function get_message_headers($uid, $folder = null, $force = false);
    /**
     * Fetch message body of a specific message from the server
@@ -471,7 +438,6 @@
     * @return string Message/part body if not printed
     */
    abstract function get_message_part($uid, $part = 1, $o_part = null, $print = null, $fp = null, $skip_charset_conv = false);
    /**
     * Fetch message body of a specific message from the server
@@ -488,7 +454,6 @@
            $headers->charset ? $headers->charset : $this->default_charset);
    }
    /**
     * Returns the whole message source as string (or saves to a file)
     *
@@ -500,7 +465,6 @@
     */
    abstract function get_raw_body($uid, $fp = null, $part = null);
    /**
     * Returns the message headers as string
     *
@@ -511,7 +475,6 @@
     */
    abstract function get_raw_headers($uid, $part = null);
    /**
     * Sends the whole message source to stdout
     *
@@ -519,7 +482,6 @@
     * @param bool $formatted Enables line-ending formatting
     */
    abstract function print_raw_body($uid, $formatted = true);
    /**
     * Set message flag to one or several messages
@@ -532,7 +494,6 @@
     * @return bool  Operation status
     */
    abstract function set_flag($uids, $flag, $folder = null, $skip_cache = false);
    /**
     * Remove message flag for one or several messages
@@ -549,7 +510,6 @@
        return $this->set_flag($uids, 'UN'.$flag, $folder);
    }
    /**
     * Append a mail message (source) to a specific folder.
     *
@@ -565,7 +525,6 @@
     */
    abstract function save_message($folder, &$message, $headers = '', $is_file = false, $flags = array(), $date = null);
    /**
     * Move message(s) from one folder to another.
     *
@@ -576,7 +535,6 @@
     * @return boolean True on success, False on error
     */
    abstract function move_message($uids, $to, $from = null);
    /**
     * Copy message(s) from one mailbox to another.
@@ -589,7 +547,6 @@
     */
    abstract function copy_message($uids, $to, $from = null);
    /**
     * Mark message(s) as deleted and expunge.
     *
@@ -599,7 +556,6 @@
     * @return boolean True on success, False on error
     */
    abstract function delete_message($uids, $folder = null);
    /**
     * Expunge message(s) and clear the cache.
@@ -611,7 +567,6 @@
     * @return boolean True on success, False on error
     */
    abstract function expunge_message($uids, $folder = null, $clear_cache = true);
    /**
     * Parse message UIDs input
@@ -666,7 +621,6 @@
     */
    abstract function list_folders_subscribed($root = '', $name = '*', $filter = null, $rights = null, $skip_sort = false);
    /**
     * Get a list of all folders available on the server.
     *
@@ -680,7 +634,6 @@
     */
    abstract function list_folders($root = '', $name = '*', $filter = null, $rights = null, $skip_sort = false);
    /**
     * Subscribe to a specific folder(s)
     *
@@ -690,7 +643,6 @@
     */
    abstract function subscribe($folders);
    /**
     * Unsubscribe folder(s)
     *
@@ -699,7 +651,6 @@
     * @return boolean True on success
     */
    abstract function unsubscribe($folders);
    /**
     * Create a new folder on the server.
@@ -711,7 +662,6 @@
     */
    abstract function create_folder($folder, $subscribe = false);
    /**
     * Set a new name to an existing folder
     *
@@ -722,7 +672,6 @@
     */
    abstract function rename_folder($folder, $new_name);
    /**
     * Remove a folder from the server.
     *
@@ -731,7 +680,6 @@
     * @return boolean True on success, False on error
     */
    abstract function delete_folder($folder);
    /**
     * Send expunge command and clear the cache.
@@ -746,7 +694,6 @@
        return $this->expunge_message('*', $folder, $clear_cache);
    }
    /**
     * Remove all messages in a folder..
     *
@@ -759,7 +706,6 @@
        return $this->delete_message('*', $folder);
    }
    /**
     * Checks if folder exists and is subscribed
     *
@@ -770,7 +716,6 @@
     */
    abstract function folder_exists($folder, $subscription = false);
    /**
     * Get folder size (size of all messages in a folder)
     *
@@ -780,7 +725,6 @@
     */
    abstract function folder_size($folder);
    /**
     * Returns the namespace where the folder is in
     *
@@ -789,7 +733,6 @@
     * @return string One of 'personal', 'other' or 'shared'
     */
    abstract function folder_namespace($folder);
    /**
     * Gets folder attributes (from LIST response, e.g. \Noselect, \Noinferiors).
@@ -801,7 +744,6 @@
     */
    abstract function folder_attributes($folder, $force = false);
    /**
     * Gets connection (and current folder) data: UIDVALIDITY, EXISTS, RECENT,
     * PERMANENTFLAGS, UIDNEXT, UNSEEN
@@ -812,7 +754,6 @@
     */
    abstract function folder_data($folder);
    /**
     * Returns extended information about the folder.
     *
@@ -821,7 +762,6 @@
     * @return array Data
     */
    abstract function folder_info($folder);
    /**
     * Returns current status of a folder (compared to the last time use)
@@ -833,14 +773,12 @@
     */
    abstract function folder_status($folder = null, &$diff = array());
    /**
     * Synchronizes messages cache.
     *
     * @param string $folder Folder name
     */
    abstract function folder_sync($folder);
    /**
     * Modify folder name according to namespace.
@@ -854,7 +792,6 @@
     * @return string Folder name
     */
    abstract function mod_folder($folder, $mode = 'out');
    /**
     * Create all folders specified as default
@@ -876,7 +813,6 @@
        }
    }
    /**
     * Check if specified folder is a special folder
     */
@@ -884,7 +820,6 @@
    {
        return $name == 'INBOX' || in_array($name, $this->get_special_folders());
    }
    /**
     * Return configured special folders
@@ -906,7 +841,6 @@
        return $this->icache['special-folders'];
    }
    /**
     * Set special folder associations stored in backend
     */
@@ -915,7 +849,6 @@
        // should be overriden by storage class if backend supports special folders (SPECIAL-USE)
        unset($this->icache['special-folders']);
    }
    /**
     * Get mailbox quota information.
@@ -942,7 +875,6 @@
     */
    abstract function set_acl($folder, $user, $acl);
    /**
     * Removes any <identifier,rights> pair for the
     * specified user from the ACL for the specified
@@ -955,7 +887,6 @@
     */
    abstract function delete_acl($folder, $user);
    /**
     * Returns the access control list for a folder (GETACL).
     *
@@ -964,7 +895,6 @@
     * @return array User-rights array on success, NULL on error
     */
    abstract function get_acl($folder);
    /**
     * Returns information about what rights can be granted to the
@@ -977,7 +907,6 @@
     */
    abstract function list_rights($folder, $user);
    /**
     * Returns the set of rights that the current user has to a folder (MYRIGHTS).
     *
@@ -986,7 +915,6 @@
     * @return array MYRIGHTS response on success, NULL on error
     */
    abstract function my_rights($folder);
    /**
     * Sets metadata/annotations (SETMETADATA/SETANNOTATION)
@@ -998,7 +926,6 @@
     */
    abstract function set_metadata($folder, $entries);
    /**
     * Unsets metadata/annotations (SETMETADATA/SETANNOTATION)
     *
@@ -1008,7 +935,6 @@
     * @return boolean True on success, False on failure
     */
    abstract function delete_metadata($folder, $entries);
    /**
     * Returns folder metadata/annotations (GETMETADATA/GETANNOTATION).
@@ -1020,7 +946,6 @@
     * @return array Metadata entry-value hash array on success, NULL on error
     */
    abstract function get_metadata($folder, $entries, $options = array());
    /* -----------------------------------------
     *   Cache related functions
@@ -1035,7 +960,6 @@
     */
    abstract function clear_cache($key = null, $prefix_mode = false);
    /**
     * Returns cached value
     *
@@ -1045,10 +969,8 @@
     */
    abstract function get_cache($key);
    /**
     * Delete outdated cache entries
     */
    abstract function cache_gc();
}  // end class rcube_storage
}
program/lib/Roundcube/rcube_string_replacer.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2009-2012, The Roundcube Dev Team                       |
program/lib/Roundcube/rcube_text2html.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2008-2014, The Roundcube Dev Team                       |
program/lib/Roundcube/rcube_tnef_decoder.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2008-2014, The Roundcube Dev Team                       |
program/lib/Roundcube/rcube_user.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2012, The Roundcube Dev Team                       |
program/lib/Roundcube/rcube_utils.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2008-2012, The Roundcube Dev Team                       |
@@ -134,7 +134,6 @@
        return false;
    }
    /**
     * Validates IPv4 or IPv6 address
     *
@@ -179,7 +178,6 @@
        return @inet_pton($ip) !== false;
    }
    /**
     * Check whether the HTTP referer matches the current request
     *
@@ -191,7 +189,6 @@
        $referer = parse_url(self::request_header('Referer'));
        return $referer['host'] == self::request_header('Host') && $referer['path'] == $uri['path'];
    }
    /**
     * Replacing specials characters to a specific encoding type
@@ -283,7 +280,6 @@
        return $str;
    }
    /**
     * Read input value and convert it for internal use
     * Performs stripslashes() and charset conversion if necessary
@@ -323,7 +319,6 @@
        return self::parse_input_value($value, $allow_html, $charset);
    }
    /**
     * Parse/validate input value. See self::get_input_value()
@@ -375,7 +370,6 @@
        return $value;
    }
    /**
     * Convert array of request parameters (prefixed with _)
     * to a regular array with non-prefixed keys.
@@ -401,7 +395,6 @@
        return $out;
    }
    /**
     * Convert the given string into a valid HTML identifier
     * Same functionality as done in app.js with rcube_webmail.html_identifier()
@@ -415,7 +408,6 @@
            return asciiwords($str, true, '_');
        }
    }
    /**
     * Replace all css definitions with #container [def]
@@ -493,7 +485,6 @@
        return $source;
    }
    /**
     * Generate CSS classes from mimetype and filename extension
     *
@@ -524,7 +515,6 @@
        return join(" ", $classes);
    }
    /**
     * Decode escaped entities used by known XSS exploits.
     * See http://downloads.securityfocus.com/vulnerabilities/exploits/26800.eml for examples
@@ -543,7 +533,6 @@
        return $out;
    }
    /**
     * preg_replace_callback callback for xss_entity_decode
     *
@@ -555,7 +544,6 @@
    {
        return chr(hexdec($matches[1]));
    }
    /**
     * Check if we can process not exceeding memory_limit
@@ -571,7 +559,6 @@
        return $mem_limit > 0 && $memory + $need > $mem_limit ? false : true;
    }
    /**
     * Check if working in SSL mode
@@ -600,7 +587,6 @@
        return false;
    }
    /**
     * Replaces hostname variables.
@@ -639,7 +625,6 @@
        return str_replace(array('%n', '%t', '%d', '%h', '%z', '%s'), array($n, $t, $d, $h, $z, $s[2]), $name);
    }
    /**
     * Returns remote IP address and forwarded addresses if found
     *
@@ -664,7 +649,6 @@
        return $address;
    }
    /**
     * Returns the real remote IP address
@@ -746,7 +730,6 @@
        return $result;
    }
    /**
     * Improved equivalent to strtotime()
@@ -878,7 +861,6 @@
        return self::idn_convert($str, true);
    }
    /*
     * Idn_to_ascii wrapper.
     * Intl/Idn modules version of this function doesn't work with e-mail address
@@ -888,8 +870,7 @@
        return self::idn_convert($str, false);
    }
    public static function idn_convert($input, $is_utf=false)
    public static function idn_convert($input, $is_utf = false)
    {
        if ($at = strpos($input, '@')) {
            $user   = substr($input, 0, $at);
program/lib/Roundcube/rcube_vcard.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2008-2012, The Roundcube Dev Team                       |
program/lib/Roundcube/rcube_washtml.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2008-2012, The Roundcube Dev Team                       |
program/steps/addressbook/copy.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/addressbook/copy.inc                                    |
 |                                                                       |
program/steps/addressbook/delete.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/addressbook/delete.inc                                  |
 |                                                                       |
program/steps/addressbook/edit.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/addressbook/edit.inc                                    |
 |                                                                       |
program/steps/addressbook/export.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/addressbook/export.inc                                  |
 |                                                                       |
program/steps/addressbook/func.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/addressbook/func.inc                                    |
 |                                                                       |
program/steps/addressbook/groups.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/addressbook/groups.inc                                  |
 |                                                                       |
program/steps/addressbook/import.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/addressbook/import.inc                                  |
 |                                                                       |
program/steps/addressbook/list.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/addressbook/list.inc                                    |
 |                                                                       |
program/steps/addressbook/mailto.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/addressbook/mailto.inc                                  |
 |                                                                       |
program/steps/addressbook/move.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/addressbook/move.inc                                    |
 |                                                                       |
program/steps/addressbook/photo.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/addressbook/photo.inc                                   |
 |                                                                       |
program/steps/addressbook/print.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/addressbook/print.inc                                   |
 |                                                                       |
program/steps/addressbook/save.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/addressbook/save.inc                                    |
 |                                                                       |
program/steps/addressbook/search.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/addressbook/search.inc                                  |
 |                                                                       |
program/steps/addressbook/show.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/addressbook/show.inc                                    |
 |                                                                       |
program/steps/addressbook/undo.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/addressbook/undo.inc                                    |
 |                                                                       |
program/steps/addressbook/upload_photo.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/addressbook/upload_photo.inc                            |
 |                                                                       |
program/steps/mail/addcontact.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/mail/addcontact.inc                                     |
 |                                                                       |
program/steps/mail/attachments.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/mail/attachments.inc                                    |
 |                                                                       |
program/steps/mail/autocomplete.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/mail/autocomplete.inc                                   |
 |                                                                       |
program/steps/mail/check_recent.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/mail/check_recent.inc                                   |
 |                                                                       |
program/steps/mail/compose.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/mail/compose.inc                                        |
 |                                                                       |
program/steps/mail/copy.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/mail/copy.inc                                           |
 |                                                                       |
program/steps/mail/folders.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/mail/folders.inc                                        |
 |                                                                       |
program/steps/mail/func.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/mail/func.inc                                           |
 |                                                                       |
program/steps/mail/get.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/mail/get.inc                                            |
 |                                                                       |
program/steps/mail/getunread.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/mail/getunread.inc                                      |
 |                                                                       |
program/steps/mail/headers.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/mail/headers.inc                                        |
 |                                                                       |
program/steps/mail/import.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/mail/import.inc                                         |
 |                                                                       |
program/steps/mail/list.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/mail/list.inc                                           |
 |                                                                       |
program/steps/mail/list_contacts.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/mail/list_contacts.inc                                  |
 |                                                                       |
program/steps/mail/mark.inc
@@ -1,5 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/mail/mark.inc                                           |
 |                                                                       |
program/steps/mail/move_del.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/mail/move_del.inc                                       |
 |                                                                       |
program/steps/mail/pagenav.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/mail/pagenav.inc                                        |
 |                                                                       |
program/steps/mail/search.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | steps/mail/search.inc                                                 |
 |                                                                       |
program/steps/mail/search_contacts.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/mail/search_contacts.inc                                |
 |                                                                       |
program/steps/mail/sendmail.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/mail/sendmail.inc                                       |
 |                                                                       |
program/steps/mail/sendmdn.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/mail/sendmdn.inc                                        |
 |                                                                       |
program/steps/mail/show.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/mail/show.inc                                           |
 |                                                                       |
program/steps/mail/viewsource.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/mail/viewsource.inc                                     |
 |                                                                       |
program/steps/settings/about.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/settings/about.inc                                      |
 |                                                                       |
program/steps/settings/edit_folder.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/settings/edit_folder.inc                                |
 |                                                                       |
program/steps/settings/edit_identity.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/settings/edit_identity.inc                              |
 |                                                                       |
program/steps/settings/edit_prefs.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/settings/edit_prefs.inc                                 |
 |                                                                       |
program/steps/settings/edit_response.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/settings/edit_response.inc                              |
 |                                                                       |
program/steps/settings/folders.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/settings/folders.inc                                    |
 |                                                                       |
program/steps/settings/func.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/settings/func.inc                                       |
 |                                                                       |
program/steps/settings/identities.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/settings/identities.inc                                 |
 |                                                                       |
program/steps/settings/responses.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/settings/responses.inc                                  |
 |                                                                       |
program/steps/settings/save_folder.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/settings/save_folder.inc                                |
 |                                                                       |
program/steps/settings/save_identity.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/settings/save_identity.inc                              |
 |                                                                       |
program/steps/settings/save_prefs.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/settings/save_prefs.inc                                 |
 |                                                                       |
program/steps/settings/upload.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/settings/upload.inc                                     |
 |                                                                       |
program/steps/utils/error.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/utils/error.inc                                         |
 |                                                                       |
program/steps/utils/html2text.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/utils/html2text.inc                                     |
 |                                                                       |
program/steps/utils/killcache.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/utils/killcache.inc                                     |
 |                                                                       |
program/steps/utils/modcss.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/utils/modcss.inc                                        |
 |                                                                       |
program/steps/utils/save_pref.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/utils/save_pref.inc                                     |
 |                                                                       |
program/steps/utils/spell.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/utils/spell.inc                                         |
 |                                                                       |
program/steps/utils/spell_html.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/utils/spell_html.inc                                    |
 |                                                                       |
@@ -18,7 +18,6 @@
 | Author: Aleksander Machniak <alec@alec.pl>                            |
 +-----------------------------------------------------------------------+
*/
$method = rcube_utils::get_input_value('method', rcube_utils::INPUT_POST);
$lang   = rcube_utils::get_input_value('lang', rcube_utils::INPUT_POST);
program/steps/utils/text2html.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/utils/text2html.inc                                     |
 |                                                                       |