From 335d8fb4f5b0ac0ffecdb21a9ee948fbb8b68a33 Mon Sep 17 00:00:00 2001 From: XlXi Date: Mon, 14 Dec 2020 00:01:53 -0500 Subject: [PATCH] Incident ids --- WebAssemblies/API.php | 5 ++++- public/cdn/www/.htaccess | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 public/cdn/www/.htaccess diff --git a/WebAssemblies/API.php b/WebAssemblies/API.php index f6cefc8..7561a11 100644 --- a/WebAssemblies/API.php +++ b/WebAssemblies/API.php @@ -16,9 +16,12 @@ class API { } function InvokeError($errorCode, $message) { + $incident = md5(time()*8^42); + $incidentRand = ["azrt4o", "30jg49k", "nigm4gd"]; + $incident = substr_replace($incident, $incidentRand[array_rand($incidentRand)], 15, 0); http_response_code($errorCode); header("Content-Type: application/json"); - exit(API::PrettyJSONEncode(["error"=>"$message"])); + exit(API::PrettyJSONEncode(["error"=>"$message", "incidentID"=>$incident])); } function PrettyJSONEncode($array){ diff --git a/public/cdn/www/.htaccess b/public/cdn/www/.htaccess new file mode 100644 index 0000000..250131c --- /dev/null +++ b/public/cdn/www/.htaccess @@ -0,0 +1 @@ +ErrorDocument 404 /index.php \ No newline at end of file