Changeset 4973 in subversion


Ignore:
Timestamp:
Jul 27, 2011 6:52:38 AM (22 months ago)
Author:
alec
Message:
  • Generate display name before record validation
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/steps/addressbook/save.inc

    r4967 r4973  
    137137} 
    138138 
     139// Generate contact's display name (must be before validation) 
     140if (empty($a_record['name'])) { 
     141    $a_record['name'] = rcube_addressbook::compose_display_name($a_record, true); 
     142    // Reset it if equals to email address (from compose_display_name()) 
     143    if ($a_record['name'] == $a_record['email'][0]) 
     144        $a_record['name'] = ''; 
     145} 
    139146 
    140147// do input checks (delegated to $CONTACTS instance) 
     
    165172} 
    166173 
    167 // Generate contact's display name 
    168 if (empty($a_record['name'])) { 
    169     $a_record['name'] = rcube_addressbook::compose_display_name($a_record, true); 
    170     // Reset it if equals to email address (from compose_display_name()) 
    171     if ($a_record['name'] == $a_record['email'][0]) 
    172         $a_record['name'] = ''; 
    173 } 
    174  
    175174 
    176175// update an existing contact 
Note: See TracChangeset for help on using the changeset viewer.