diff options
author | RaindropsSys <contact@minteck.org> | 2023-03-15 22:40:55 +0100 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-03-15 22:40:55 +0100 |
commit | 940defd2939f52480ed5b548189b549457944995 (patch) | |
tree | 7ca52eca3c3fcafe507dc24b4e2812ab785acc29 /pages/api | |
parent | eb89b15c0f044673c1206a418a21d0baba1a675e (diff) | |
download | pluralconnect-940defd2939f52480ed5b548189b549457944995.tar.gz pluralconnect-940defd2939f52480ed5b548189b549457944995.tar.bz2 pluralconnect-940defd2939f52480ed5b548189b549457944995.zip |
Updated 14 files (automated)
Diffstat (limited to 'pages/api')
-rw-r--r-- | pages/api/chrome.php | 3 | ||||
-rw-r--r-- | pages/api/computer.php | 3 | ||||
-rw-r--r-- | pages/api/pluralkit-integration.php | 8 | ||||
-rw-r--r-- | pages/api/ponytown.php | 2 |
4 files changed, 10 insertions, 6 deletions
diff --git a/pages/api/chrome.php b/pages/api/chrome.php index 0be8a94..3b49ec7 100644 --- a/pages/api/chrome.php +++ b/pages/api/chrome.php @@ -80,6 +80,9 @@ if (!isset($_GET["t"])) { <?php die(); + case "unique": + header("Content-Type: text/plain"); + die("Chromebook-" . strtoupper(substr(sha1($_COOKIE['PEH2_SESSION_TOKEN']), 0, 5))); default: header("Location: /"); die(); diff --git a/pages/api/computer.php b/pages/api/computer.php index 8261fa8..a9b87ae 100644 --- a/pages/api/computer.php +++ b/pages/api/computer.php @@ -1,7 +1,8 @@ <?php if (isset($_GET["chrome"])) { - header("Access-Control-Allow-Origin: chrome-extension://klenhenmabddpffgdaijdkjmfkkafbno"); + header("Access-Control-Allow-Origin: chrome-extension://" . preg_replace("/[^a-z]/m", "", $_GET["chrome"])); + header("Access-Control-Allow-Credentials: true"); } require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $_PROFILE; diff --git a/pages/api/pluralkit-integration.php b/pages/api/pluralkit-integration.php index f5bb4dd..b7abc6b 100644 --- a/pages/api/pluralkit-integration.php +++ b/pages/api/pluralkit-integration.php @@ -43,20 +43,20 @@ $lastFronter = json_decode(@file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/incl if ($input["type"] === "CREATE_SWITCH" || $input["type"] === "UPDATE_SWITCH" || $input["type"] === "DELETE_SWITCH") { if ($system === $app["other"]["id"]) { - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json", file_get_contents("https://pluralkit.equestria.dev/v2/systems/$input[system_id]/fronters"), false, stream_context_create([ + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json", file_get_contents("https://pluralkit.equestria.dev/v2/systems/$input[system_id]/fronters", false, stream_context_create([ 'http' => [ 'method' => 'GET', 'header' => "Authorization: " . $app["other"]["token"] . "\r\n" ] - ])); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/switches.json", file_get_contents("https://pluralkit.equestria.dev/v2/systems/$input[system_id]/switches"), false, stream_context_create([ + ]))); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/switches.json", file_get_contents("https://pluralkit.equestria.dev/v2/systems/$input[system_id]/switches", false, stream_context_create([ 'http' => [ 'method' => 'GET', 'header' => "Authorization: " . $app["other"]["token"] . "\r\n" ] - ])); + ]))); } else { file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json", file_get_contents("https://pluralkit.equestria.dev/v2/systems/$input[system_id]/fronters")); file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/switches.json", file_get_contents("https://pluralkit.equestria.dev/v2/systems/$input[system_id]/switches")); diff --git a/pages/api/ponytown.php b/pages/api/ponytown.php index e75ea33..99d755c 100644 --- a/pages/api/ponytown.php +++ b/pages/api/ponytown.php @@ -82,7 +82,7 @@ foreach ([1, 2] as $_) { $errors[] = "0x{$_}000002B: Image #" . $_ . " is higher than it should, are you sure you set zoom to 1x? Maybe you inverted the files?"; } - if ($_ === 2 && $size[0] > 35) { + if ($_ === 2 && $size[0] > 40) { $errors[] = "0x{$_}000002A: Image #" . $_ . " is wider than it should, are you sure you set zoom to 1x? Maybe you inverted the files?"; } |