What steps will reproduce the problem?
1. getting presence notice from a user without a resource (no /)
2.
3.
What is the expected output? What do you see instead?
We get a PHP notice for an undefined array element.
What version of the product are you using? On what operating system?
Please provide any additional information below.
Not sure if a blank resource string is desirable, but it fixes the issue.
FIX:
public function setPresence($presence, $priority, $show, $status) {
if (strpos($presence,'/')===FALSE) {
$jid=$presence;
$resource='';
} else {
list($jid, $resource) = split("/", $presence);
}
if ($show != 'unavailable') {
if (!$this->isContact($jid)) {
$this->addContact($jid, 'not-in-roster');
}
$resource = $resource ? $resource : '';
$this->roster_array[$jid]['presence'][$resource] =
array('priority' => $priority, 'show' => $show, 'status' => $status);
} else { //Nuke unavailable resources to save memory
unset($this->roster_array[$jid]['resource'][$resource]);
}
}
Original issue reported on code.google.com by darkf...@gmail.com on 5 May 2010 at 10:41
Original issue reported on code.google.com by
darkf...@gmail.com
on 5 May 2010 at 10:41