Aleksander Machniak
2015-08-05 93e64008a674afbad215c1d42bf5fa758a5c1a5e
Small code improvements
7 files modified
34 ■■■■■ changed files
program/include/rcmail_output_html.php 9 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_imap_generic.php 3 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_message.php 3 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_result_thread.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_session.php 1 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_utils.php 4 ●●●● patch | view | raw | blame | history
program/steps/addressbook/func.inc 12 ●●●●● patch | view | raw | blame | history
program/include/rcmail_output_html.php
@@ -262,11 +262,14 @@
        $meta = @file_get_contents(RCUBE_INSTALL_PATH . $skin_path . '/meta.json');
        $meta = @json_decode($meta, true);
        $meta['path'] = $skin_path;
        $skin_id = end(explode('/', $skin_path));
        $meta['path']  = $skin_path;
        $path_elements = explode('/', $skin_path);
        $skin_id       = end($path_elements);
        if (!$meta['name']) {
            $meta['name'] = $skin_id;
        }
        $this->skins[$skin_id] = $meta;
        if ($meta['extends']) {
@@ -956,7 +959,7 @@
                "rcube_utils::get_input_value('\\1', rcube_utils::INPUT_GPC)",
                "\$_COOKIE['\\1']",
                "\$browser->{'\\1'}",
                $this->template_name,
                "'" . $this->template_name . "'",
            ),
            $expression
        );
program/lib/Roundcube/rcube_imap_generic.php
@@ -690,7 +690,8 @@
        list($code, $response) = $this->execute('NAMESPACE');
        if ($code == self::ERROR_OK && preg_match('/^\* NAMESPACE /', $response)) {
            $data = $this->tokenizeResponse(substr($response, 11));
            $response = substr($response, 11);
            $data     = $this->tokenizeResponse($response);
        }
        if (!is_array($data)) {
program/lib/Roundcube/rcube_message.php
@@ -96,8 +96,7 @@
            return;
        }
        $this->mime = new rcube_mime($this->headers->charset);
        $this->mime    = new rcube_mime($this->headers->charset);
        $this->subject = $this->headers->get('subject');
        list(, $this->sender) = each($this->mime->decode_address_list($this->headers->from, 1));
program/lib/Roundcube/rcube_result_thread.php
@@ -413,7 +413,7 @@
     */
    public function get_parameters($param=null)
    {
        $params = $this->params;
        $params = array();
        $params['MAILBOX'] = $this->mailbox;
        $params['ORDER']   = $this->order;
program/lib/Roundcube/rcube_session.php
@@ -40,6 +40,7 @@
    protected $reloaded     = false;
    protected $appends      = array();
    protected $unsets       = array();
    protected $gc_enabled   = 0;
    protected $gc_handlers  = array();
    protected $cookiename   = 'roundcube_sessauth';
    protected $secret       = '';
program/lib/Roundcube/rcube_utils.php
@@ -253,8 +253,8 @@
            $js_rep_table["'"]  = "\\'";
            $js_rep_table["\\"] = "\\\\";
            // Unicode line and paragraph separators (#1486310)
            $js_rep_table[chr(hexdec(E2)).chr(hexdec(80)).chr(hexdec(A8))] = '
';
            $js_rep_table[chr(hexdec(E2)).chr(hexdec(80)).chr(hexdec(A9))] = '
';
            $js_rep_table[chr(hexdec('E2')).chr(hexdec('80')).chr(hexdec('A8'))] = '
';
            $js_rep_table[chr(hexdec('E2')).chr(hexdec('80')).chr(hexdec('A9'))] = '
';
        }
        // encode for javascript use
program/steps/addressbook/func.inc
@@ -371,19 +371,21 @@
{
    global $OUTPUT, $RCMAIL;
    if (empty($result) || $result->count == 0)
    if (empty($result) || $result->count == 0) {
        return;
    }
    // define list of cols to be displayed
    $a_show_cols = array('name','action');
    while ($row = $result->next()) {
        $row['CID'] = $row['ID'];
        $row['email'] = reset(rcube_addressbook::get_col_values('email', $row, true));
        $emails       = rcube_addressbook::get_col_values('email', $row, true);
        $row['CID']   = $row['ID'];
        $row['email'] = reset($emails);
        $source_id = $OUTPUT->get_env('source');
        $source_id  = $OUTPUT->get_env('source');
        $a_row_cols = array();
        $classes = array($row['_type'] ? $row['_type'] : 'person');
        $classes    = array($row['_type'] ? $row['_type'] : 'person');
        // build contact ID with source ID
        if (isset($row['sourceid'])) {