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; }