Skip to content

Commit

Permalink
[mms] Fix setting default port for POP3 URLs.
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Aug 19, 2014
1 parent 2e17156 commit 13ff280
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
18 changes: 15 additions & 3 deletions framework/Imap_Client/lib/Horde/Imap/Client/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,20 @@ public function __toString()

$url .= $this->hostspec;

if (!is_null($this->port) && ($this->port != 143)) {
$url .= ':' . $this->port;
if (!is_null($this->port)) {
switch ($this->protocol) {
case 'imap':
if ($this->port != 143) {
$url .= ':' . $this->port;
}
break;

case 'pop':
if ($this->port != 110) {
$url .= ':' . $this->port;
}
break;
}
}
}

Expand Down Expand Up @@ -218,7 +230,7 @@ protected function _parse($url)
}
$this->port = isset($data['port'])
? $data['port']
: 143;
: (($protocol === 'imap') ? 143 : 110);
$this->protocol = $protocol;
}

Expand Down
2 changes: 2 additions & 0 deletions framework/Imap_Client/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mms] Fix setting default port for POP3 URLs.
* [mms] Fix client-side reverse sorting.
* [mms] Fix client-side sequence sorting, when that is the only sort criteria.
* [mms] Use Collator class, if present, to sort string fields on the client side.
Expand Down Expand Up @@ -2648,6 +2649,7 @@
<date>2014-08-19</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mms] Fix setting default port for POP3 URLs.
* [mms] Fix client-side reverse sorting.
* [mms] Fix client-side sequence sorting, when that is the only sort criteria.
* [mms] Use Collator class, if present, to sort string fields on the client side.
Expand Down

0 comments on commit 13ff280

Please sign in to comment.