summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2010-10-06 08:02:47 +0000
committerthomascube <thomas@roundcube.net>2010-10-06 08:02:47 +0000
commitcb8ebfcbf8cf72f1aeb44b4fcdd62e071cc00368 (patch)
treef66c22e0411b469e0fdbfb62ff582669c9aba46b /program
parentcecf83a48d3bde732f5cffacd0499f67ff23254c (diff)
Hotfixes for release 0.4.1 building new 0.4.2 version
Diffstat (limited to 'program')
-rwxr-xr-xprogram/include/iniset.php4
-rw-r--r--program/include/rcube_imap_generic.php76
-rw-r--r--program/include/rcube_vcard.php6
-rw-r--r--program/js/app.js4
-rw-r--r--program/steps/mail/func.inc3
5 files changed, 43 insertions, 50 deletions
diff --git a/program/include/iniset.php b/program/include/iniset.php
index b4027ecbd..c2c07fc90 100755
--- a/program/include/iniset.php
+++ b/program/include/iniset.php
@@ -5,7 +5,7 @@
| program/include/iniset.php |
| |
| This file is part of the Roundcube Webmail client |
- | Copyright (C) 2008-2009, Roundcube Dev, - Switzerland |
+ | Copyright (C) 2008-2010, Roundcube Dev, - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
@@ -36,7 +36,7 @@ foreach ($crit_opts as $optname => $optval) {
}
// application constants
-define('RCMAIL_VERSION', '0.4.1');
+define('RCMAIL_VERSION', '0.4.2');
define('RCMAIL_CHARSET', 'UTF-8');
define('JS_OBJECT_NAME', 'rcmail');
define('RCMAIL_START', microtime(true));
diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php
index b60ddc76e..bfbf072c3 100644
--- a/program/include/rcube_imap_generic.php
+++ b/program/include/rcube_imap_generic.php
@@ -423,23 +423,7 @@ class rcube_imap_generic
return true;
}
- if (!$this->getCapability('NAMESPACE')) {
- return false;
- }
-
- if (!$this->putLine("ns1 NAMESPACE")) {
- return false;
- }
- do {
- $line = $this->readLine(1024);
- if (preg_match('/^\* NAMESPACE/', $line)) {
- $i = 0;
- $line = $this->unEscape($line);
- $data = $this->parseNamespace(substr($line,11), $i, 0, 0);
- }
- } while (!$this->startsWith($line, 'ns1', true, true));
-
- if (!is_array($data)) {
+ if (!is_array($data = $this->_namespace())) {
return false;
}
@@ -488,13 +472,9 @@ class rcube_imap_generic
}
do {
- $line = $this->readLine(500);
- if ($line[0] == '*') {
- $line = rtrim($line);
- $a = rcube_explode_quoted_string(' ', $this->unEscape($line));
- if ($a[0] == '*') {
- $delimiter = str_replace('"', '', $a[count($a)-2]);
- }
+ $line = $this->readLine(1024);
+ if (preg_match('/^\* LIST \([^\)]*\) "*([^"]+)"* ""/', $line, $m)) {
+ $delimiter = $this->unEscape($m[1]);
}
} while (!$this->startsWith($line, 'ghd', true, true));
@@ -504,23 +484,10 @@ class rcube_imap_generic
// if that fails, try namespace extension
// try to fetch namespace data
- if (!$this->putLine("ns1 NAMESPACE")) {
+ if (!is_array($data = $this->_namespace())) {
return false;
}
- do {
- $line = $this->readLine(1024);
- if (preg_match('/^\* NAMESPACE/', $line)) {
- $i = 0;
- $line = $this->unEscape($line);
- $data = $this->parseNamespace(substr($line,11), $i, 0, 0);
- }
- } while (!$this->startsWith($line, 'ns1', true, true));
-
- if (!is_array($data)) {
- return false;
- }
-
// extract user space data (opposed to global/shared space)
$user_space_data = $data[0];
if (!is_array($user_space_data)) {
@@ -539,6 +506,31 @@ class rcube_imap_generic
return $delimiter;
}
+ function _namespace()
+ {
+ if (!$this->getCapability('NAMESPACE')) {
+ return false;
+ }
+
+ if (!$this->putLine("ns1 NAMESPACE")) {
+ return false;
+ }
+
+ do {
+ $line = $this->readLine(1024);
+ if (preg_match('/^\* NAMESPACE/', $line)) {
+ $i = 0;
+ $data = $this->parseNamespace(substr($line,11), $i, 0, 0);
+ }
+ } while (!$this->startsWith($line, 'ns1', true, true));
+
+ if (!is_array($data)) {
+ return false;
+ }
+
+ return $data;
+ }
+
function connect($host, $user, $password, $options=null)
{
// set options
@@ -1660,9 +1652,9 @@ class rcube_imap_generic
// folder name
$folders[] = preg_replace(array('/^"/', '/"$/'), '', $this->unEscape($m[3]));
// attributes
-// $attrib = explode(' ', $m[1]);
+// $attrib = explode(' ', $this->unEscape($m[1]));
// delimiter
-// $delim = $m[2];
+// $delim = $this->unEscape($m[2]);
}
} while (!$this->startsWith($line, $key, true));
@@ -2173,7 +2165,7 @@ class rcube_imap_generic
$in_quotes = false;
$elem = 0;
- for ($i;$i<$len;$i++) {
+ for ($i; $i<$len; $i++) {
$c = (string)$str[$i];
if ($c == '(' && !$in_quotes) {
$i++;
@@ -2184,7 +2176,7 @@ class rcube_imap_generic
} else if ($c == '\\') {
$i++;
if ($in_quotes) {
- $data[$elem] .= $c.$str[$i];
+ $data[$elem] .= $str[$i];
}
} else if ($c == '"') {
$in_quotes = !$in_quotes;
diff --git a/program/include/rcube_vcard.php b/program/include/rcube_vcard.php
index 0eb7a780d..9bbc32b3c 100644
--- a/program/include/rcube_vcard.php
+++ b/program/include/rcube_vcard.php
@@ -218,7 +218,9 @@ class rcube_vcard
if ($in_vcard_block && !empty($line))
$vcard_block .= $line . "\n";
- if (trim($line) == 'END:VCARD') {
+ $line = trim($line);
+
+ if (preg_match('/^END:VCARD$/i', $line)) {
// parse vcard
$obj = new rcube_vcard(self::cleanup($vcard_block), $charset);
if (!empty($obj->displayname))
@@ -226,7 +228,7 @@ class rcube_vcard
$in_vcard_block = false;
}
- else if (trim($line) == 'BEGIN:VCARD') {
+ else if (preg_match('/^BEGIN:VCARD$/i', $line)) {
$vcard_block = $line . "\n";
$in_vcard_block = true;
}
diff --git a/program/js/app.js b/program/js/app.js
index 64cc7c631..5dec2ad39 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -1292,7 +1292,7 @@ function rcube_webmail()
}
}
- this.http_post('utils/save-pref', '_name=collapsed_folders&_value='+urlencode(this.env.collapsed_folders));
+ this.http_post('save-pref', '_name=collapsed_folders&_value='+urlencode(this.env.collapsed_folders));
this.set_unread_count_display(id, false);
};
@@ -1463,7 +1463,7 @@ function rcube_webmail()
if ((found = $.inArray('subject', this.env.coltypes)) >= 0)
this.set_env('subject_col', found);
- this.http_post('utils/save-pref', { '_name':'list_cols', '_value':this.env.coltypes, '_session':'list_attrib/columns' });
+ this.http_post('save-pref', { '_name':'list_cols', '_value':this.env.coltypes, '_session':'list_attrib/columns' });
};
this.check_droptarget = function(id)
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 119a5da31..0d12a5bde 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -661,7 +661,7 @@ function rcmail_wash_html($html, $p = array(), $cid_replaces)
// charset was converted to UTF-8 in rcube_imap::get_message_part(),
// -> change charset specification in HTML accordingly
- $charset_pattern = '(<meta\s+[^>]* content=)[\'"]?(\w+\/\w+;\s*charset=)([a-z0-9-_]+[\'"]?)';
+ $charset_pattern = '(<meta\s+[^>]*content=)[\'"]?(\w+\/\w+;\s*charset=)([a-z0-9-_]+[\'"]?)';
if (preg_match("/$charset_pattern/Ui", $html)) {
$html = preg_replace("/$charset_pattern/i", '\\1"\\2'.RCMAIL_CHARSET.'"', $html);
}
@@ -671,7 +671,6 @@ function rcmail_wash_html($html, $p = array(), $cid_replaces)
$html = '<head></head>'. $html;
$html = substr_replace($html, '<meta http-equiv="Content-Type" content="text/html; charset='.RCMAIL_CHARSET.'" />', intval(stripos($html, '<head>')+6), 0);
}
-
// turn relative into absolute urls
$html = rcmail_resolve_base($html);