MDL-52335 core: php7 compatibility in XMPP library
authorMarina Glancy <marina@moodle.com>
Wed, 2 Dec 2015 06:00:58 +0000 (14:00 +0800)
committerMarina Glancy <marina@moodle.com>
Wed, 2 Dec 2015 06:00:58 +0000 (14:00 +0800)
lib/jabber/XMPP/XMLStream.php
lib/jabber/readme_moodle.txt

index 73ab3fe..5c71426 100644 (file)
@@ -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) {
index f8328fb..205c214 100644 (file)
@@ -1,3 +1,4 @@
 Description of XMPPHP (aka jabber) version 0.1rc2-r77 library import into Moodle
 
 MDL-20876 - replaced deprecated split() with explode()
+MDL-52335 - PHP7 variable syntax changes