From e61e581a2b66b0444db01d884465ea913929e343 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Tue, 31 Oct 2023 17:04:34 +0100 Subject: Updated 27 files, added 12 files and deleted 3 files (automated) --- api/saveProfile.php | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 api/saveProfile.php (limited to 'api/saveProfile.php') diff --git a/api/saveProfile.php b/api/saveProfile.php new file mode 100644 index 0000000..eee3e9c --- /dev/null +++ b/api/saveProfile.php @@ -0,0 +1,40 @@ + [ + "method" => "GET", + "header" => "User-Agent: Mozilla/5.0 (+MistProfile/1.0; raindrops@equestria.dev)\r\n" + ] + ])), true); + + if (isset($data) && json_last_error() === JSON_ERROR_NONE && isset($data["image"]) && isset($data["image"]["view_url"])) { + $profile["banner"] = $data["image"]["view_url"]; + $profile["banner_orig"] = substr(strip_tags($_POST["url"]), 0, 120); + } else { + $profile["banner"] = $profile["banner_orig"] = substr(strip_tags($_POST["url"]), 0, 120); + } + } +} + +file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/users/" . $_PROFILE["id"] . "-profileSettings.json", json_encode($profile)); \ No newline at end of file -- cgit