#1484467: fix problems with backslash as imap hierarchy delimiter

release-0.6
alecpl 16 years ago
parent 12bc8b6fa2
commit b7c1685b2d

@ -1,6 +1,10 @@
CHANGELOG RoundCube Webmail
---------------------------
2009/01/18 (alec)
----------
- Fix problems with backslash as IMAP hierarchy delimiter (#1484467)
2009/01/15 (alec)
----------
- Allow absolute URLs to images in HTML messages/sigs (#1485666)

@ -1568,7 +1568,6 @@ class rcube_imap
*/
function save_message($mbox_name, &$message)
{
$mbox_name = stripslashes($mbox_name);
$mailbox = $this->_mod_mailbox($mbox_name);
// make sure mailbox exists
@ -1595,9 +1594,7 @@ class rcube_imap
*/
function move_message($uids, $to_mbox, $from_mbox='')
{
$to_mbox_in = stripslashes($to_mbox);
$from_mbox = stripslashes($from_mbox);
$to_mbox = $this->_mod_mailbox($to_mbox_in);
$to_mbox = $this->_mod_mailbox($to_mbox);
$from_mbox = $from_mbox ? $this->_mod_mailbox($from_mbox) : $this->mailbox;
// make sure mailbox exists
@ -1672,7 +1669,6 @@ class rcube_imap
*/
function delete_message($uids, $mbox_name='')
{
$mbox_name = stripslashes($mbox_name);
$mailbox = $mbox_name ? $this->_mod_mailbox($mbox_name) : $this->mailbox;
// convert the list of uids to array
@ -1729,7 +1725,6 @@ class rcube_imap
*/
function clear_mailbox($mbox_name=NULL)
{
$mbox_name = stripslashes($mbox_name);
$mailbox = !empty($mbox_name) ? $this->_mod_mailbox($mbox_name) : $this->mailbox;
$msg_count = $this->_messagecount($mailbox, 'ALL');
@ -1762,7 +1757,6 @@ class rcube_imap
*/
function expunge($mbox_name='', $clear_cache=TRUE)
{
$mbox_name = stripslashes($mbox_name);
$mailbox = $mbox_name ? $this->_mod_mailbox($mbox_name) : $this->mailbox;
return $this->_expunge($mailbox, $clear_cache);
}
@ -1881,9 +1875,6 @@ class rcube_imap
{
$result = FALSE;
// replace backslashes
$name = preg_replace('/[\\\]+/', '-', $name);
// reduce mailbox name to 100 chars
$name = substr($name, 0, 100);
@ -1912,9 +1903,6 @@ class rcube_imap
{
$result = FALSE;
// replace backslashes
$name = preg_replace('/[\\\]+/', '-', $new_name);
// encode mailbox name and reduce it to 100 chars
$name = substr($new_name, 0, 100);

@ -53,7 +53,7 @@
- Removed some debuggers (echo ...)
File altered by Aleksander Machniak <alec@alec.pl>
- trim(chop()) replaced by trim()
- added iil_Escape() with support for " and \ in folder names
- added iil_Escape()/iil_UnEscape() with support for " and \ in folder names
- support \ character in username in iil_C_Login()
- fixed iil_MultLine(): use iil_ReadBytes() instead of iil_ReadLine()
- fixed iil_C_FetchStructureString() to handle many literal strings in response
@ -338,6 +338,11 @@ function iil_Escape($string)
return strtr($string, array('"'=>'\\"', '\\' => '\\\\'));
}
function iil_UnEscape($string)
{
return strtr($string, array('\\"'=>'"', '\\\\' => '\\'));
}
function iil_C_GetCapability(&$conn, $name)
{
if (in_array($name, $conn->capability)) {
@ -497,6 +502,7 @@ function iil_C_NameSpace(&$conn) {
$line = iil_ReadLine($conn->fp, 1024);
if (iil_StartsWith($line, '* NAMESPACE')) {
$i = 0;
$line = iil_UnEscape($line);
$data = iil_ParseNamespace2(substr($line,11), $i, 0, 0);
}
} while (!iil_StartsWith($line, 'ns1', true));
@ -2199,7 +2205,7 @@ function iil_C_GetHierarchyDelimiter(&$conn) {
$line=iil_ReadLine($fp, 500);
if ($line[0] == '*') {
$line = rtrim($line);
$a=iil_ExplodeQuotedString(' ', $line);
$a=iil_ExplodeQuotedString(' ', iil_UnEscape($line));
if ($a[0] == '*') {
$delimiter = str_replace('"', '', $a[count($a)-2]);
}
@ -2209,7 +2215,7 @@ function iil_C_GetHierarchyDelimiter(&$conn) {
if (strlen($delimiter)>0) {
return $delimiter;
}
//if that fails, try namespace extension
//try to fetch namespace data
iil_PutLine($conn->fp, "ns1 NAMESPACE");
@ -2217,6 +2223,7 @@ function iil_C_GetHierarchyDelimiter(&$conn) {
$line = iil_ReadLine($conn->fp, 1024);
if (iil_StartsWith($line, '* NAMESPACE')) {
$i = 0;
$line = iil_UnEscape($line);
$data = iil_ParseNamespace2(substr($line,11), $i, 0, 0);
}
} while (!iil_StartsWith($line, 'ns1', true));

Loading…
Cancel
Save