Merge branch 'master' of github.com:roundcube/roundcubemail
| | |
| | | $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; |
| | | } |
| | | |
| | |
| | | */ |
| | | static function uncompressMessageSet($messages) |
| | | { |
| | | if (empty($messages)) { |
| | | return array(); |
| | | } |
| | | |
| | | $result = array(); |
| | | $messages = explode(',', $messages); |
| | | |
| | |
| | | $max = max($items[0], $items[1]); |
| | | |
| | | for ($x=$items[0]; $x<=$max; $x++) { |
| | | $result[] = $x; |
| | | $result[] = (int)$x; |
| | | } |
| | | unset($messages[$idx]); |
| | | } |
| | |
| | | |
| | | // literal-string |
| | | return sprintf("{%d}\r\n%s", strlen($string), $string); |
| | | } |
| | | |
| | | /** |
| | | * Unescapes quoted-string |
| | | * |
| | | * @param string $string IMAP string |
| | | * |
| | | * @return string String |
| | | */ |
| | | static function unEscape($string) |
| | | { |
| | | return stripslashes($string); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | $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); |
| | | } |
| | | } |