Revert "Apply fixes from StyleCI"

This commit is contained in:
SuperDev
2023-01-19 11:46:03 -06:00
committed by GitHub
parent 3dc11557a0
commit 78f5305c38
16 changed files with 492 additions and 496 deletions

18
api.php
View File

@@ -4,17 +4,17 @@
$code = isset($_GET['code']) ? $_GET['code'] : '';
// If the code isn't in the correct format, CloudFlare will throw a 1020
if (!preg_match('/^([a-f0-9]{8})-(([a-f0-9]{4})-){3}([a-f0-9]{12}) *$/i', $code)) {
http_response_code(403);
echo 'error code: 1020';
exit;
if (!preg_match("/^([a-f0-9]{8})-(([a-f0-9]{4})-){3}([a-f0-9]{12}) *$/i", $code)) {
http_response_code(403);
echo "error code: 1020";
die;
}
header('Content-Type: application/json; charset=utf-8');
// Handle valid codes
if ($code == '86781236-23d0-4b3c-7dfa-c1c147e0dece') {
echo <<<'EOD'
if ($code == "86781236-23d0-4b3c-7dfa-c1c147e0dece") {
echo <<<EOD
{
"amount": "19.84",
"sold_at": "2016-09-07T10:54:28+10:00",
@@ -38,11 +38,11 @@ EOD;
// Handle invalid codes
else {
http_response_code(404);
echo <<<'EOD'
http_response_code(404);
echo <<<EOD
{
"error": 404,
"description": "No sale belonging to the current user found with that code"
}
EOD;
}
}