summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2012-11-06 13:21:11 +0100
committerThomas Bruederli <thomas@roundcube.net>2012-11-06 13:21:11 +0100
commitc50fa82bec631b018fd6288d97b7813dc86daf20 (patch)
tree5a27bce961af6f98692673c8ad6950145df5f493
parent28de3911825bde79ee5a92762940ef310baab737 (diff)
parent37633a6c794fd35ce3cda8766f8583301a090ba4 (diff)
Merge branch 'master' of github.com:roundcube/roundcubemail
-rw-r--r--program/include/rcube_db_mysql.php3
-rw-r--r--program/include/rcube_imap_generic.php18
-rw-r--r--tests/Framework/ImapGeneric.php18
3 files changed, 26 insertions, 13 deletions
diff --git a/program/include/rcube_db_mysql.php b/program/include/rcube_db_mysql.php
index 2cdcf3021..6f0acba54 100644
--- a/program/include/rcube_db_mysql.php
+++ b/program/include/rcube_db_mysql.php
@@ -127,6 +127,9 @@ class rcube_db_mysql extends rcube_db
$result[PDO::MYSQL_ATTR_SSL_CA] = $dsn['ca'];
}
+ // Always return matching (not affected only) rows count
+ $result[PDO::MYSQL_ATTR_FOUND_ROWS] = true;
+
return $result;
}
diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php
index 52bf0e37a..651de9d97 100644
--- a/program/include/rcube_imap_generic.php
+++ b/program/include/rcube_imap_generic.php
@@ -3530,6 +3530,10 @@ class rcube_imap_generic
*/
static function uncompressMessageSet($messages)
{
+ if (empty($messages)) {
+ return array();
+ }
+
$result = array();
$messages = explode(',', $messages);
@@ -3538,7 +3542,7 @@ class rcube_imap_generic
$max = max($items[0], $items[1]);
for ($x=$items[0]; $x<=$max; $x++) {
- $result[] = $x;
+ $result[] = (int)$x;
}
unset($messages[$idx]);
}
@@ -3654,18 +3658,6 @@ class rcube_imap_generic
}
/**
- * Unescapes quoted-string
- *
- * @param string $string IMAP string
- *
- * @return string String
- */
- static function unEscape($string)
- {
- return stripslashes($string);
- }
-
- /**
* Set the value of the debugging flag.
*
* @param boolean $debug New value for the debugging flag.
diff --git a/tests/Framework/ImapGeneric.php b/tests/Framework/ImapGeneric.php
index 0b2cc3d53..2f9b6d10f 100644
--- a/tests/Framework/ImapGeneric.php
+++ b/tests/Framework/ImapGeneric.php
@@ -17,4 +17,22 @@ class Framework_ImapGeneric extends PHPUnit_Framework_TestCase
$this->assertInstanceOf('rcube_imap_generic', $object, "Class constructor");
}
+
+ /**
+ * Test for uncompressMessageSet
+ */
+ function test_uncompressMessageSet()
+ {
+ $result = rcube_imap_generic::uncompressMessageSet(null);
+ $this->assertSame(array(), $result);
+ $this->assertCount(0, $result);
+
+ $result = rcube_imap_generic::uncompressMessageSet('1');
+ $this->assertSame(array(1), $result);
+ $this->assertCount(1, $result);
+
+ $result = rcube_imap_generic::uncompressMessageSet('1:3');
+ $this->assertSame(array(1, 2, 3), $result);
+ $this->assertCount(3, $result);
+ }
}