Changeset f1adbf17 in github


Ignore:
Timestamp:
Oct 4, 2010 3:03:00 AM (3 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
619d58a
Parents:
df2188d
Message:
  • Convert IDN to ASCII before using rcube_user::query()
  • Always convert to lower case a username when it's an email address
File:
1 edited

Legend:

Unmodified
Added
Removed
  • program/include/rcmail.php

    r13ffa28 rf1adbf17  
    684684        $username = $virtuser; 
    685685 
     686    // Here we need IDNA ASCII 
     687    // Only rcube_contacts class is using domain names in Unicode 
     688    $host = idn_to_ascii($host); 
     689    if (strpos($username, '@')) { 
     690      // lowercase username if it's an e-mail address (#1484473) 
     691      $username = mb_strtolower($username); 
     692      $username = idn_to_ascii($username); 
     693    } 
     694 
    686695    // user already registered -> overwrite username 
    687696    if ($user = rcube_user::query($username, $host)) 
     
    691700      $this->imap_init(); 
    692701 
    693     // Here we need IDNA ASCII 
    694     // Only rcube_contacts class is using domain names in Unicode 
    695     $host = idn_to_ascii($host); 
    696     if (strpos($username, '@')) 
    697       $username = idn_to_ascii($username); 
    698  
    699702    // try IMAP login 
    700703    if (!($imap_login = $this->imap->connect($host, $username, $pass, $imap_port, $imap_ssl))) { 
    701       // lowercase username if it's an e-mail address (#1484473) 
     704      // try with lowercase 
    702705      $username_lc = mb_strtolower($username); 
    703706      if ($username_lc != $username && ($imap_login = $this->imap->connect($host, $username_lc, $pass, $imap_port, $imap_ssl))) 
Note: See TracChangeset for help on using the changeset viewer.