Permalink
Browse files

- Applied fixes from trunk up to r6118

  • Loading branch information...
1 parent 2cadfbb commit a57f9e2c64a8495ccb89a8b79eba6052483a0ede @alecpl alecpl committed Apr 23, 2012
View
@@ -12,6 +12,7 @@ CHANGELOG Roundcube Webmail
- Fix invisible cursor when replying to a html message (#1487073)
- Reset IP stored in session when destroying session data (#1488056)
- Fix bug where memory_limit = -1 wasn't handled properly
+- Support mutliple name/email pairs for Bcc and Reply-To identity settings (#1488445)
- Support LDAP RFC2256's country object class read/write (#1488123)
- Upgraded to jQuery 1.7.2
- Image resize with GD extension (#1488383)
@@ -5,7 +5,7 @@
*
* Driver to change passwords via DirectAdmin Control Panel
*
- * @version 2.0
+ * @version 2.1
* @author Victor Benincasa <vbenincasa@gmail.com>
*
*/
@@ -62,16 +62,17 @@ public function save($curpass, $passwd)
*
* Very, very basic usage:
* $Socket = new HTTPSocket;
- * echo $Socket->get('http://user:pass@somesite.com/somedir/some.file?query=string&this=that');
+ * echo $Socket->get('http://user:pass@somehost.com:2222/CMD_API_SOMEAPI?query=string&this=that');
*
* @author Phi1 'l0rdphi1' Stier <l0rdphi1@liquenox.net>
+ * @updates 2.7 and 2.8 by Victor Benincasa <vbenincasa @ gmail.com>
* @package HTTPSocket
- * @version 2.7 (Updated by Victor Benincasa <vbenincasa@gmail.com>)
+ * @version 2.8
*/
class HTTPSocket {
- var $version = '2.7';
-
+ var $version = '2.8';
+
/* all vars are private except $error, $query_cache, and $doFollowLocationHeader */
var $method = 'GET';
@@ -107,7 +108,7 @@ function connect($host, $port = '' )
{
if (!is_numeric($port))
{
- $port = 80;
+ $port = 2222;
}
$this->remote_host = $host;
@@ -166,13 +167,13 @@ function query( $request, $content = '', $doSpeedCheck = 0 )
$this->error = $this->warn = array();
$this->result_status_code = NULL;
- // is our request a http:// ... ?
- if (preg_match('!^http://!i',$request))
+ // is our request a http(s):// ... ?
+ if (preg_match('/^(http|https):\/\//i',$request))
{
$location = parse_url($request);
$this->connect($location['host'],$location['port']);
$this->set_login($location['user'],$location['pass']);
-
+
$request = $location['path'];
$content = $location['query'];
@@ -185,7 +186,7 @@ function query( $request, $content = '', $doSpeedCheck = 0 )
$array_headers = array(
'User-Agent' => "HTTPSocket/$this->version",
- 'Host' => ( $this->remote_port == 80 ? $this->remote_host : "$this->remote_host:$this->remote_port" ),
+ 'Host' => ( $this->remote_port == 80 ? parse_url($this->remote_host,PHP_URL_HOST) : parse_url($this->remote_host,PHP_URL_HOST).":".$this->remote_port ),
'Accept' => '*/*',
'Connection' => 'Close' );
@@ -325,7 +326,7 @@ function query( $request, $content = '', $doSpeedCheck = 0 )
}
}
-
+
list($this->result_header,$this->result_body) = preg_split("/\r\n\r\n/",$this->result,2);
if ($this->bind_host)
@@ -364,6 +365,7 @@ function query( $request, $content = '', $doSpeedCheck = 0 )
$this->query($headers['location']);
}
}
+
}
function getTransferSpeed()
@@ -447,7 +449,7 @@ function fetch_result()
function fetch_header( $header = '' )
{
$array_headers = preg_split("/\r\n/",$this->result_header);
-
+
$array_return = array( 0 => $array_headers[0] );
unset($array_headers[0]);
@@ -15,10 +15,10 @@
<email>roundcube@gmail.com</email>
<active>yes</active>
</lead>
- <date>2011-11-21</date>
+ <date>2012-04-23</date>
<version>
- <release>1.1</release>
- <api>1.1</api>
+ <release>2.0</release>
+ <api>2.0</api>
</version>
<stability>
<release>stable</release>
@@ -42,9 +42,8 @@ function message_headers($p)
{
$rcmail = rcmail::get_instance();
foreach ((array)$rcmail->config->get('show_additional_headers', array()) as $header) {
- $key = strtolower($header);
- if ($value = $p['headers']->others[$key])
- $p['output'][$key] = array('title' => $header, 'value' => Q($value));
+ if ($value = $p['headers']->get($header))
+ $p['output'][$header] = array('title' => $header, 'value' => Q($value));
}
return $p;
@@ -1213,7 +1213,9 @@ public function index_direct($folder, $sort_field = null, $sort_order = null, $s
}
// use message index sort as default sorting
else if (!$sort_field) {
+ // use search result from count() if possible
if ($this->options['skip_deleted'] && !empty($this->icache['undeleted_idx'])
+ && $this->icache['undeleted_idx']->get_parameters('ALL') !== null
&& $this->icache['undeleted_idx']->get_parameters('MAILBOX') == $folder
) {
$index = $this->icache['undeleted_idx'];
@@ -1650,7 +1650,7 @@ function search($mailbox, $criteria, $return_uid=false, $items=array())
// If ESEARCH is supported always use ALL
// but not when items are specified or using simple id2uid search
- if (empty($items) && ((int) $criteria != $criteria)) {
+ if (empty($items) && preg_match('/[^0-9]/', $criteria)) {
$items = array('ALL');
}
@@ -89,18 +89,18 @@ public function init($data = null)
$param = strtoupper($m[1]);
$value = $m[2];
- $this->params[strtoupper($m[1])] = $value;
+ $this->params[$param] = $value;
$data_item = substr($data_item, strlen($m[0]));
if (in_array($param, array('COUNT', 'MIN', 'MAX'))) {
- $this->meta[strtolower($param)] = (int) $m[2];
+ $this->meta[strtolower($param)] = (int) $value;
}
}
// @TODO: Implement compression using compressMessageSet() in __sleep() and __wakeup() ?
// @TODO: work with compressed result?!
if (isset($this->params['ALL'])) {
- $data[$idx] = implode(self::SEPARATOR_ELEMENT,
+ $data_item = implode(self::SEPARATOR_ELEMENT,
rcube_imap_generic::uncompressMessageSet($this->params['ALL']));
}
}
@@ -111,6 +111,8 @@ public function init($data = null)
unset($data[$i]);
}
+ $data = array_filter($data);
+
if (empty($data)) {
return;
}
Oops, something went wrong.

0 comments on commit a57f9e2

Please sign in to comment.