]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
encode values when inserting into MeteorUpdater JS
authorEvan Prodromou <evan@status.net>
Tue, 2 Aug 2011 17:49:27 +0000 (13:49 -0400)
committerEvan Prodromou <evan@status.net>
Tue, 2 Aug 2011 17:49:27 +0000 (13:49 -0400)
plugins/Meteor/MeteorPlugin.php

index 6e93e364f736b900211e567672ef5ab8f781b368..3d36c67f57bdca2d1b45b3d5c1ed56a77dca8088 100644 (file)
@@ -96,7 +96,11 @@ class MeteorPlugin extends RealtimePlugin
     function _updateInitialize($timeline, $user_id)
     {
         $script = parent::_updateInitialize($timeline, $user_id);
-        return $script." MeteorUpdater.init(\"$this->webserver\", $this->webport, \"{$timeline}\");";
+        $ours = sprintf("MeteorUpdater.init(%s, %s, %s);",
+                                       json_encode($this->webserver),
+                                       json_encode($this->webport),
+                                       json_encode($timeline));
+        return $script." ".$ours;
     }
 
     function _connect()