From fa4634337870b30b8c240fd3fd296b60f8efc5f9 Mon Sep 17 00:00:00 2001 From: fritzy Date: Wed, 26 Nov 2008 10:16:33 +0000 Subject: [PATCH] * fixed small bugs git-svn-id: svn://netflint.net/xmpphp@67 ef36c318-a008-4979-b6e8-6b496270793b --- XMPPHP/BOSH.php | 2 +- XMPPHP/XMLStream.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/XMPPHP/BOSH.php b/XMPPHP/BOSH.php index a5d39f9..b147443 100644 --- a/XMPPHP/BOSH.php +++ b/XMPPHP/BOSH.php @@ -65,7 +65,7 @@ class XMPPHP_BOSH extends XMPPHP_XMPP { $body->addAttribute('to', $this->host); $body->addAttribute('route', "xmpp:{$this->host}:{$this->port}"); $body->addAttribute('secure','true'); - $body->addAttribute('version','1.6'); + $body->addAttribute('xmpp:version','1.6', 'urn:xmpp:xbosh'); $body->addAttribute('wait', strval($wait)); $body->addAttribute('ack','1'); $body->addAttribute('xmlns:xmpp','urn:xmpp:xbosh'); diff --git a/XMPPHP/XMLStream.php b/XMPPHP/XMLStream.php index 809716f..fb167d2 100644 --- a/XMPPHP/XMLStream.php +++ b/XMPPHP/XMLStream.php @@ -330,6 +330,9 @@ class XMPPHP_XMLStream { */ public function disconnect() { $this->log->log("Disconnecting...", XMPPHP_Log::LEVEL_VERBOSE); + if(false == (bool) $this->socket) { + return; + } $this->reconnect = false; $this->send($this->stream_end); $this->sent_disconnect = true; @@ -490,7 +493,7 @@ class XMPPHP_XMLStream { #clean-up old objects #$found = false; #FIXME This didn't appear to be in use --Gar foreach($this->xpathhandlers as $handler) { - if (array_key_exists(2, $this->xmlobj)) { + if (is_array($this->xmlobj) && array_key_exists(2, $this->xmlobj)) { $searchxml = $this->xmlobj[2]; $nstag = array_shift($handler[0]); if (($nstag[0] == null or $searchxml->ns == $nstag[0]) and ($nstag[1] == "*" or $nstag[1] == $searchxml->name)) {