Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixing issue #2554 #3170

Closed
wants to merge 5 commits into from

3 participants

@jcrawford

Removing the transport from the connected host prior to comparing and closing the connection.

library/Zend/Http/Client/Adapter/Socket.php
@@ -189,7 +189,11 @@ public function getStreamContext()
public function connect($host, $port = 80, $secure = false)
{
// If we are connected to the wrong host, disconnect first
- if (($this->connected_to[0] != $host || $this->connected_to[1] != $port)) {
+ $connected_host = (strpos($this->connected_to[0], '://'))
+ ? substr($this->connected_to[0], (strpos($this->connected_to[0], '://') + 3), strlen($this->connected_to[0]))
+ : $this->connected_to[0];
+
+ if (($connected_host != $host || $this->connected_to[1] != $port)) {

i think it's over "((" and "))", should be only :

 if ($connected_host != $host || $this->connected_to[1] != $port) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jcrawford

@samsonasik good call, I failed to notice the double parenthesis. I have fixed this.

@weierophinney weierophinney closed this pull request from a commit
@weierophinney weierophinney Merge branch 'hotfix/3170'
Close #3170
Fixes #2554
3028234
@ghost Unknown referenced this pull request from a commit
@weierophinney weierophinney Merge branch 'hotfix/3170'
Close #3170
Fixes #2554
c3ae477
@ghost Unknown referenced this pull request from a commit
@weierophinney weierophinney Merge branch 'hotfix/3170' into develop
Forward port #3170
f169760
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 5, 2012
  1. Fixing issue #2554 removing the transport:// from the host before com…

    Joseph Crawford authored
    …paring
  2. Fixing issue #2554 adding spacing for clarity

    Joseph Crawford authored
  3. removing a double set of parenthesis

    Joseph Crawford authored
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 1 deletion.
  1. +5 −1 library/Zend/Http/Client/Adapter/Socket.php
View
6 library/Zend/Http/Client/Adapter/Socket.php
@@ -189,7 +189,11 @@ public function getStreamContext()
public function connect($host, $port = 80, $secure = false)
{
// If we are connected to the wrong host, disconnect first
- if (($this->connected_to[0] != $host || $this->connected_to[1] != $port)) {
+ $connected_host = (strpos($this->connected_to[0], '://'))
+ ? substr($this->connected_to[0], (strpos($this->connected_to[0], '://') + 3), strlen($this->connected_to[0]))
+ : $this->connected_to[0];
+
+ if ($connected_host != $host || $this->connected_to[1] != $port) {
if (is_resource($this->socket)) {
$this->close();
}
Something went wrong with that request. Please try again.