diff options
| author | Maksymilian Jopek <maks@jopek.eu> | 2022-03-25 15:05:15 +0100 |
|---|---|---|
| committer | Maksymilian Jopek <maks@jopek.eu> | 2022-03-25 15:05:15 +0100 |
| commit | 3df4ebc26d93afed16670e37edb26aa3b5a17317 (patch) | |
| tree | 462838b07a70bf6a2aced9541bfe81f08be0e05c /api | |
| parent | ca297c3df1cacc902cadb21bea4dbf525913325a (diff) | |
| download | mlos-3df4ebc26d93afed16670e37edb26aa3b5a17317.tar.gz mlos-3df4ebc26d93afed16670e37edb26aa3b5a17317.tar.zst mlos-3df4ebc26d93afed16670e37edb26aa3b5a17317.zip | |
Hotfix, remove all JS
Diffstat (limited to 'api')
| -rw-r--r-- | api/add.php | 4 | ||||
| -rw-r--r-- | api/set-session.php | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/api/add.php b/api/add.php index b2e4c2d..780a3b4 100644 --- a/api/add.php +++ b/api/add.php @@ -1,4 +1,5 @@ <?php +session_start(); $req_keys = ["name", "author", "thumbnail", "magazine"]; header("Location: " . $_SERVER["HTTP_REFERER"]); foreach ($req_keys as $key) { @@ -22,12 +23,11 @@ error_log("ID: " . $id); if ($id) { $xpath = new DOMXpath($doc); $game = $xpath->query('//game[@id="' . $id . '"]')->item(0); - var_dump($game); - var_dump($game->getElementsByTagName); $xpath->query('//game[@id="' . $id . '"]/name')->item(0)->nodeValue = $name; $xpath->query('//game[@id="' . $id . '"]/author')->item(0)->nodeValue = $author; $xpath->query('//game[@id="' . $id . '"]/thumbnail')->item(0)->nodeValue = $thumbnail; $xpath->query('//game[@id="' . $id . '"]/magazine')->item(0)->nodeValue = $magazine; + $_SESSION["eid"] = null; } else { $root = $doc->getElementsByTagName("root")->item(0); $game = $doc->createElement("game", ""); diff --git a/api/set-session.php b/api/set-session.php new file mode 100644 index 0000000..a644b12 --- /dev/null +++ b/api/set-session.php @@ -0,0 +1,4 @@ +<?php +session_start(); +$_SESSION["eid"] = $_GET["eid"]; +header("Location: " . $_SERVER["HTTP_REFERER"]); |
