diff options
Diffstat (limited to 'pages/metadata.inc')
-rw-r--r-- | pages/metadata.inc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/pages/metadata.inc b/pages/metadata.inc index 04579a8..b254ceb 100644 --- a/pages/metadata.inc +++ b/pages/metadata.inc @@ -53,10 +53,6 @@ if ($member === null) { header("Content-Type: text/plain"); - if (isset($_GET["bitset"]) && is_numeric($_GET["bitset"])) { - $toUpdate["bitset"] = (int)$_GET["bitset"]; - } - if (isset($_GET["food"]) && is_numeric($_GET["food"])) { $toUpdate["food"] = (int)$_GET["food"]; } @@ -125,6 +121,12 @@ if ($member === null) { })); } + if (isset($_GET["friends"])) { + $toUpdate["friends"] = array_values(array_filter(array_map(function ($i) { return trim($i); }, explode(",", $_GET["friends"])), function ($i) use ($regex) { + return !!preg_match($regex, $i); + })); + } + if (isset($_GET['regressed'])) { if (!!preg_match("/^[a-z]{5}$/m", $_GET['regressed'])) { $toUpdate["regression"] = $_GET['regressed']; @@ -175,6 +177,7 @@ if ($member === null) { } if (isset($metadata["bitset"])) unset($metadata["bitset"]); + if (isset($metadata["code"])) unset($metadata["code"]); if (trim($metadata["species"][1]) === "") unset($metadata["species"][1]); file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json", json_encode($metadata)); |