Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
Fix detection of Auth mechanisms. <mechanisms> is not neccessarily a …
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan-Kaspar Münnich committed Oct 9, 2014
1 parent ea46d9c commit f698f07
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/XmppPrebind.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit f698f07

Please sign in to comment.