fixes error in getJidDomain(JID) in case of a JID with resource identifier

This commit is contained in:
steckbrief 2018-10-14 12:52:17 +02:00
parent 35ad320c69
commit 840bd494f9

View file

@ -13,7 +13,7 @@ function getJidDomain($jid) {
if ($slashIndex !== false) {
if ($slashIndex > $atIndex) {// 'local@domain.foo/resource' and 'local@domain.foo/res@otherres' case
return substr($jid, $atIndex + 1, $slashIndex - $atIndex + 1);
return substr($jid, $atIndex + 1, $slashIndex - $atIndex - 1);
} else {// 'domain.foo/res@otherres' case
return substr($jid, 0, $slashIndex);
}