diff --git a/src/API/History/Index.php b/src/API/History/Index.php index 948ca3e8..177ca9d0 100644 --- a/src/API/History/Index.php +++ b/src/API/History/Index.php @@ -135,7 +135,7 @@ final class Index ); } - if (preg_match('/[^a-zA-Z0-9_]/', $sField)) { + if (preg_match('/[^a-zA-Z0-9_\.]/', $sField)) { return api_error( 'Invalid value for key query string expected value format is [a-zA-Z0-9_].', HTTP_STATUS::HTTP_BAD_REQUEST @@ -166,7 +166,7 @@ final class Index ); } - if (preg_match('/[^a-zA-Z0-9_]/', $sField)) { + if (preg_match('/[^a-zA-Z0-9_\.]/', $sField)) { return api_error( 'Invalid value for key query string expected value format is [a-zA-Z0-9_].', HTTP_STATUS::HTTP_BAD_REQUEST diff --git a/src/API/System/Env.php b/src/API/System/Env.php new file mode 100644 index 00000000..a74c1cbd --- /dev/null +++ b/src/API/System/Env.php @@ -0,0 +1,36 @@ + (string)$request->getUri()->withHost('')->withPort(0)->withScheme(''), + 'data' => [], + ]; + + foreach (getenv() as $key => $val) { + if (false === str_starts_with($key, 'WS_') && $key !== 'HTTP_PORT') { + continue; + } + $response['data'][] = [ + 'key' => $key, + 'value' => $val, + ]; + } + + return api_response($response, HTTP_STATUS::HTTP_OK, []); + } +}