mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-10 10:06:52 +01:00
Patches for 20051021 release
This commit is contained in:
@@ -253,6 +253,15 @@ function rcmail_login($user, $pass, $host=NULL)
|
||||
if (!$host)
|
||||
$host = $CONFIG['default_host'];
|
||||
|
||||
// parse $host URL
|
||||
$a_host = parse_url($host);
|
||||
if ($a_host['host'])
|
||||
{
|
||||
$host = $a_host['host'];
|
||||
$imap_ssl = (isset($a_host['scheme']) && in_array($a_host['scheme'], array('ssl','imaps','tls'))) ? TRUE : FALSE;
|
||||
$imap_port = isset($a_host['port']) ? $a_host['port'] : ($imap_ssl ? 993 : $CONFIG['default_port']);
|
||||
}
|
||||
|
||||
// query if user already registered
|
||||
$sql_result = $DB->query(sprintf("SELECT user_id, username, language, preferences
|
||||
FROM %s
|
||||
@@ -269,15 +278,6 @@ function rcmail_login($user, $pass, $host=NULL)
|
||||
$user = $sql_arr['username'];
|
||||
}
|
||||
|
||||
// parse $host URL
|
||||
$a_host = parse_url($host);
|
||||
if ($a_host['host'])
|
||||
{
|
||||
$host = $a_host['host'];
|
||||
$imap_ssl = (isset($a_host['scheme']) && in_array($a_host['scheme'], array('ssl','imaps','tls'))) ? TRUE : FALSE;
|
||||
$imap_port = isset($a_host['port']) ? $a_host['port'] : ($imap_ssl ? 993 : $CONFIG['default_port']);
|
||||
}
|
||||
|
||||
// exit if IMAP login failed
|
||||
if (!($imap_login = $IMAP->connect($host, $user, $pass, $imap_port, $imap_ssl)))
|
||||
return FALSE;
|
||||
|
||||
@@ -1086,10 +1086,10 @@ class rcube_imap
|
||||
|
||||
function _mod_mailbox($mbox, $mode='in')
|
||||
{
|
||||
if (!empty($this->root_ns) && $this->root_ns == $mbox)
|
||||
if ((!empty($this->root_ns) && $this->root_ns == $mbox) || ($mbox == 'INBOX' && $mode == 'in'))
|
||||
return $mbox;
|
||||
|
||||
if (!empty($this->root_dir) && $mode=='in')
|
||||
if (!empty($this->root_dir) && $mode=='in')
|
||||
$mbox = $this->root_dir.$this->delimiter.$mbox;
|
||||
else if (strlen($this->root_dir) && $mode=='out')
|
||||
$mbox = substr($mbox, strlen($this->root_dir)+1);
|
||||
|
||||
@@ -1245,7 +1245,7 @@ function rep_specialchars_output($str, $enctype='', $mode='', $newlines=TRUE)
|
||||
|
||||
// encode for javascript use
|
||||
if ($enctype=='js')
|
||||
return preg_replace(array("/\r\n/", '/"/', "/'/"), array('\n', '\"', "\'"), strtr($str, $js_rep_table));
|
||||
return preg_replace(array("/\r\n/", '/"/', "/([^\\\])'/"), array('\n', '\"', "$1\'"), strtr($str, $js_rep_table));
|
||||
|
||||
// encode for RTF
|
||||
if ($enctype=='rtf')
|
||||
|
||||
Reference in New Issue
Block a user