From ec69ea86eb612a550d9a40b3374e37f20cd9c956 Mon Sep 17 00:00:00 2001
From: Matthias Konitzny <konitzny@ibr.cs.tu-bs.de>
Date: Thu, 14 Oct 2021 09:59:26 +0200
Subject: [PATCH] Repaired some broken variables.

---
 knowledge-space.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/knowledge-space.php b/knowledge-space.php
index 15004a6..6a3e8dc 100644
--- a/knowledge-space.php
+++ b/knowledge-space.php
@@ -91,9 +91,9 @@ function update_space() {
     if (current_user_can("edit_posts")) {
         $plugin_dir = plugin_dir_path(__FILE__);
         // Use json encoding.
-        $payload = json_encode($_POST["payload"]);
-        $filename = $plugin_dir . $payload["space"] . ".json";
-        $result = file_put_contents($filename, $payload["graph"]);
+        $payload = json_encode($_POST["graph"]);
+        $filename = $plugin_dir . $_POST["space"] . ".json";
+        $result = file_put_contents($filename, $payload);
 
         //echo print_r($_POST);
         echo "Saved file at ";
-- 
GitLab