]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Naughty fix for extlib XMPPHP (PHP7)
authorMikael Nordfeldth <mmn@hethane.se>
Tue, 26 Apr 2016 00:41:04 +0000 (02:41 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Tue, 26 Apr 2016 00:41:04 +0000 (02:41 +0200)
I shouldn't fix extlibs, but here goes anyway. I will see if there's
an upstream library we can track which has fixed this themselves.

plugins/Xmpp/extlib/XMPPHP/Roster.php
plugins/Xmpp/extlib/XMPPHP/XMLStream.php

index 2e459e2a2f672182f632ed184d3689790cecc908..69457b22a195454a27a093673129c92ebcab7917 100644 (file)
@@ -118,7 +118,7 @@ class Roster {
         * @param string $status
        */
        public function setPresence($presence, $priority, $show, $status) {
-               list($jid, $resource) = split("/", $presence);
+               list($jid, $resource) = explode("/", $presence);
                if ($show != 'unavailable') {
                        if (!$this->isContact($jid)) {
                                $this->addContact($jid, 'not-in-roster');
@@ -137,7 +137,7 @@ class Roster {
         * @param string $jid
         */
        public function getPresence($jid) {
-               $split = split("/", $jid);
+               $split = explode("/", $jid);
                $jid = $split[0];
                if($this->isContact($jid)) {
                        $current = array('resource' => '', 'active' => '', 'priority' => -129, 'show' => '', 'status' => ''); //Priorities can only be -128 = 127
index d33411ec54140dafc1c527c946d05cbc931807c9..5c71426200f31f8fe7a3b1a48aace879cd1935bc 100644 (file)
@@ -263,7 +263,7 @@ class XMPPHP_XMLStream {
                        $ns_tags = array($xpath);
                }
                foreach($ns_tags as $ns_tag) {
-                       list($l, $r) = split("}", $ns_tag);
+                       list($l, $r) = explode("}", $ns_tag);
                        if ($r != null) {
                                $xpart = array(substr($l, 1), $r);
                        } else {
@@ -564,7 +564,7 @@ class XMPPHP_XMLStream {
                                                if ($searchxml !== null) {
                                                        if($handler[2] === null) $handler[2] = $this;
                                                        $this->log->log("Calling {$handler[1]}",  XMPPHP_Log::LEVEL_DEBUG);
-                                                       $handler[2]->$handler[1]($this->xmlobj[2]);
+                                                       $handler[2]->{$handler[1]}($this->xmlobj[2]);
                                                }
                                        }
                                }
@@ -578,13 +578,13 @@ class XMPPHP_XMLStream {
                                if($searchxml !== null and $searchxml->name == $handler[0] and ($searchxml->ns == $handler[1] or (!$handler[1] and $searchxml->ns == $this->default_ns))) {
                                        if($handler[3] === null) $handler[3] = $this;
                                        $this->log->log("Calling {$handler[2]}",  XMPPHP_Log::LEVEL_DEBUG);
-                                       $handler[3]->$handler[2]($this->xmlobj[2]);
+                                       $handler[3]->{$handler[2]}($this->xmlobj[2]);
                                }
                        }
                        foreach($this->idhandlers as $id => $handler) {
                                if(array_key_exists('id', $this->xmlobj[2]->attrs) and $this->xmlobj[2]->attrs['id'] == $id) {
                                        if($handler[1] === null) $handler[1] = $this;
-                                       $handler[1]->$handler[0]($this->xmlobj[2]);
+                                       $handler[1]->{$handler[0]}($this->xmlobj[2]);
                                        #id handlers are only used once
                                        unset($this->idhandlers[$id]);
                                        break;
@@ -640,7 +640,7 @@ class XMPPHP_XMLStream {
                                if($handler[2] === null) {
                                        $handler[2] = $this;
                                }
-                               $handler[2]->$handler[1]($payload);
+                               $handler[2]->{$handler[1]}($payload);
                        }
                }
                foreach($this->until as $key => $until) {