Aleksander Machniak
2012-12-18 d2534c63f2c0b640a39fce2a71b14a5dcda6e7fd
program/lib/Roundcube/rcube_addressbook.php
@@ -2,8 +2,6 @@
/*
 +-----------------------------------------------------------------------+
 | program/include/rcube_addressbook.php                                 |
 |                                                                       |
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2006-2012, The Roundcube Dev Team                       |
 |                                                                       |
@@ -13,7 +11,6 @@
 |                                                                       |
 | PURPOSE:                                                              |
 |   Interface to the local address book database                        |
 |                                                                       |
 +-----------------------------------------------------------------------+
 | Author: Thomas Bruederli <roundcube@gmail.com>                        |
 +-----------------------------------------------------------------------+
@@ -209,13 +206,13 @@
     */
    public function validate(&$save_data, $autofix = false)
    {
        $rcmail = rcmail::get_instance();
        $rcube = rcube::get_instance();
        // check validity of email addresses
        foreach ($this->get_col_values('email', $save_data, true) as $email) {
            if (strlen($email)) {
                if (!rcube_utils::check_email(rcube_utils::idn_to_ascii($email))) {
                    $error = $rcmail->gettext(array('name' => 'emailformaterror', 'vars' => array('email' => $email)));
                    $error = $rcube->gettext(array('name' => 'emailformaterror', 'vars' => array('email' => $email)));
                    $this->set_error(self::ERROR_VALIDATE, $error);
                    return false;
                }
@@ -467,7 +464,7 @@
     */
    public static function compose_display_name($contact, $full_email = false)
    {
        $contact = rcmail::get_instance()->plugins->exec_hook('contact_displayname', $contact);
        $contact = rcube::get_instance()->plugins->exec_hook('contact_displayname', $contact);
        $fn = $contact['name'];
        if (!$fn)  // default display name composition according to vcard standard
@@ -504,7 +501,7 @@
        static $compose_mode;
        if (!isset($compose_mode))  // cache this
            $compose_mode = rcmail::get_instance()->config->get('addressbook_name_listing', 0);
            $compose_mode = rcube::get_instance()->config->get('addressbook_name_listing', 0);
        if ($compose_mode == 3)
            $fn = join(' ', array($contact['surname'] . ',', $contact['firstname'], $contact['middlename']));