Replace usage of deprecated split() function with explode().

This commit is contained in:
Mat Gadd 2010-02-25 15:51:04 +00:00
parent b9a9fb85d7
commit fe80cd6f48
2 changed files with 3 additions and 3 deletions

View File

@ -118,7 +118,7 @@ class Roster {
* @param string $status * @param string $status
*/ */
public function setPresence($presence, $priority, $show, $status) { public function setPresence($presence, $priority, $show, $status) {
list($jid, $resource) = split("/", $presence); list($jid, $resource) = explode('/', $presence, 2);
if ($show != 'unavailable') { if ($show != 'unavailable') {
if (!$this->isContact($jid)) { if (!$this->isContact($jid)) {
$this->addContact($jid, 'not-in-roster'); $this->addContact($jid, 'not-in-roster');
@ -137,7 +137,7 @@ class Roster {
* @param string $jid * @param string $jid
*/ */
public function getPresence($jid) { public function getPresence($jid) {
$split = split("/", $jid); $split = explode('/', $jid, 2);
$jid = $split[0]; $jid = $split[0];
if($this->isContact($jid)) { if($this->isContact($jid)) {
$current = array('resource' => '', 'active' => '', 'priority' => -129, 'show' => '', 'status' => ''); //Priorities can only be -128 = 127 $current = array('resource' => '', 'active' => '', 'priority' => -129, 'show' => '', 'status' => ''); //Priorities can only be -128 = 127

View File

@ -263,7 +263,7 @@ class XMPPHP_XMLStream {
$ns_tags = array($xpath); $ns_tags = array($xpath);
} }
foreach($ns_tags as $ns_tag) { foreach($ns_tags as $ns_tag) {
list($l, $r) = split("}", $ns_tag); list($l, $r) = explode('}', $ns_tag);
if ($r != null) { if ($r != null) {
$xpart = array(substr($l, 1), $r); $xpart = array(substr($l, 1), $r);
} else { } else {