From f698f07a0424152a8b22f3e527f65faaf2574060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Kaspar=20Mu=CC=88nnich?= Date: Thu, 9 Oct 2014 21:10:05 +0200 Subject: [PATCH] Fix detection of Auth mechanisms. is not neccessarily a child of (http://xmpp.org/rfcs/rfc3920.html#tls) --- lib/XmppPrebind.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/XmppPrebind.php b/lib/XmppPrebind.php index f9323c1..de31160 100644 --- a/lib/XmppPrebind.php +++ b/lib/XmppPrebind.php @@ -133,13 +133,8 @@ public function connect($username, $password) { $this->sid = $body->getAttribute('sid'); $this->debug($this->sid, 'sid'); - $child = $body->firstChild->firstChild; - if (is_object($child)) { - $mechanisms = $child->getElementsByTagName('mechanism'); - } else { - throw new Exception('Invalid response'); - } - + $mechanisms = $body->getElementsByTagName('mechanism'); + foreach ($mechanisms as $value) { $this->mechanisms[] = $value->nodeValue; }