* fixed small bugs

git-svn-id: svn://netflint.net/xmpphp@67 ef36c318-a008-4979-b6e8-6b496270793b
This commit is contained in:
fritzy 2008-11-26 10:16:33 +00:00
parent f2bfbe252c
commit fa46343378
2 changed files with 5 additions and 2 deletions

View File

@ -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');

View File

@ -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)) {